aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-10-30 12:55:01 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-10-30 12:55:01 +0100
commit9af7039353c25b8a24861491cdfac81353b86ef7 (patch)
tree929b747c768cfbd2cf08f7cf5207e1f3339678b7
parented3ba0ee7d8546711be9d4c800dc4f4f0a81aedf (diff)
downloadglutte-o-matic-9af7039353c25b8a24861491cdfac81353b86ef7.tar.gz
glutte-o-matic-9af7039353c25b8a24861491cdfac81353b86ef7.tar.bz2
glutte-o-matic-9af7039353c25b8a24861491cdfac81353b86ef7.zip
Add bonne annee
-rw-r--r--src/common/Core/fsm.c5
-rw-r--r--src/common/Core/fsm.h2
-rw-r--r--src/common/Core/main.c9
3 files changed, 13 insertions, 3 deletions
diff --git a/src/common/Core/fsm.c b/src/common/Core/fsm.c
index da70329..928882f 100644
--- a/src/common/Core/fsm.c
+++ b/src/common/Core/fsm.c
@@ -673,7 +673,10 @@ void fsm_update() {
fsm_out.msg_frequency = 696;
fsm_out.cw_dit_duration = 70;
- {
+ if (fsm_in.bonne_annee) {
+ fsm_out.msg = CW_PREDELAY "HB9G BONNE ANNEE" CW_POSTDELAY;
+ }
+ else {
int rand = random_bool() * 2 + random_bool();
if (rand == 0) {
diff --git a/src/common/Core/fsm.h b/src/common/Core/fsm.h
index 4921f04..5fad22a 100644
--- a/src/common/Core/fsm.h
+++ b/src/common/Core/fsm.h
@@ -81,8 +81,8 @@ struct fsm_input_signals_t {
int qrp; // The relay is currently running with low power
int hour_is_even; // 1 if hour is even
int send_stats; // 1 if the balise should contain stats
+ int bonne_annee; // 1 if BONNE ANNEE should be sent in short beacons
float temp; // temperature in degrees C
- float humidity; // relative humidity, range [0-100] %
int wind_generator_ok; // false if the generator is folded out of the wind
int discrim_d; // FM discriminator says RX is too low in frequency
int button_1750; // Front panel button 1750Hz
diff --git a/src/common/Core/main.c b/src/common/Core/main.c
index 52f1663..e1ae35d 100644
--- a/src/common/Core/main.c
+++ b/src/common/Core/main.c
@@ -600,11 +600,12 @@ static void exercise_fsm(void __attribute__ ((unused))*pvParameters)
uint64_t last_qrp_stats_updated = timestamp_now();
- fsm_input.humidity = 0;
fsm_input.temp = 15;
fsm_input.swr_high = 0;
fsm_input.fax_mode = 0;
fsm_input.wind_generator_ok = 1;
+ fsm_input.send_stats = 0;
+ fsm_input.bonne_annee = 0;
while (1) {
vTaskDelay(pdMS_TO_TICKS(10));
@@ -681,8 +682,14 @@ static void exercise_fsm(void __attribute__ ((unused))*pvParameters)
if (!time_valid) {
time_valid = local_derived_time(&time);
}
+
if (time_valid) {
fsm_input.send_stats = (time.tm_hour == 22) ? 1 : 0;
+ fsm_input.bonne_annee = (gps_time.tm_mon == 0 && gps_time.tm_mday <= 5);
+ }
+ else {
+ fsm_input.send_stats = 0;
+ fsm_input.bonne_annee = 0;
}
fsm_update_inputs(&fsm_input);