From 37b766c2fc6772a88d6ede523184116aeb667c58 Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Sat, 28 Oct 2023 22:27:47 +0100 Subject: [PATCH] update sos --- app/app.c | 11 +++++++---- firmware.bin | Bin 59900 -> 59896 bytes firmware.packed.bin | Bin 59918 -> 59914 bytes 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/app.c b/app/app.c index e51e1842..9a37ce59 100644 --- a/app/app.c +++ b/app/app.c @@ -1423,7 +1423,7 @@ void APP_process_flash_light_10ms(void) break; case FLASHLIGHT_ON: - GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); + GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); break; case FLASHLIGHT_BLINK: @@ -1432,9 +1432,12 @@ void APP_process_flash_light_10ms(void) break; case FLASHLIGHT_SOS: - { - const unsigned int bit = (g_flash_light_blink_tick_10ms / 15) % (32 + 6); // 150ms tick - if (bit < 32 && (sos & (1u << (31 - bit)))) + { // 150ms tick + // '15' sets the morse speed, lower value = faster speed + // '+ 6' lengthens the loop time + const unsigned int num_bits = sizeof(sos) * 8; + const unsigned int bit = (g_flash_light_blink_tick_10ms / 15) % (num_bits + 6); + if (bit < num_bits && (sos & (1u << ((num_bits - 1) - bit)))) GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // ON else GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); // OFF diff --git a/firmware.bin b/firmware.bin index 762a0d2a725a5e345d9819c53ec1e5ab6dba581d..0be9d9a651348e61f013de17c9cc9a267e8b85dd 100644 GIT binary patch delta 377 zcmex!nfb?M<_!nf7$0mt$o4piamVJRna_<_&pc&dSTcFy9Cc2WmkbQ|fOy&FgLB%M z7}sz1oWGw-aXV0C0|$dbDFcIo5)*@h$2kUutuGiDE&}m+Mh1oTn>AMjGmE|ja@l~= zYgrf+bXge`n1I^2CQn=|EGi6SMFC}`fwU4(vnG%>-Mn+{bbi4pK;|wW_63@A0!Uw; zoVeFp)(*%z`Iv#h3rK@(_W|Ph&lwoffOP)mlY6f-xk`A;YZ~2XP!eK0=BEdoc-ali zjSWqcEjH_&D-e=}a@lS>qgEEJ3kjEohGjI4~ztPG4d?|#6`$_io{Z9e<-I@9E3 jFQ$OG#*^(|E|y?r1o{(bJP5NaD`a}XJb_V|k&zJqRXcfL delta 361 zcmexynfcFU<_!nf7@urD$o4piao6Uhna_<_m%LzLST=d$9Cc2$mkbOKfOy5`gLB%M z7&mVAoWGw-aVJn@0|$dbDFcIo5)*@h$2kUu?La-3f%rTlgTltmnyZ4DMc)ItY(VL? zEDQ>|tPBb)Ky5seC$1G16$P@QfHJZ`S_!CG8%UdP-nn)pSd zfkR0$gUea#K?KmSGn@X|(fVgGz(*sVt>?w(f z#wkXYoAu5W2+2Y@Itu>DB??9s3PuJ-#tKG8Rt5%ECI*{#Kj39$1u~5-H=liaor%$C Y^5Pd$K>{WQlWkuvW@2EN{NSYo09C4a;Q#;t diff --git a/firmware.packed.bin b/firmware.packed.bin index cc0e656f01708435f5fbb576d5034df78c2a6d37..ecca7047e7dd60a448f08eef8a062cb199a0b5d4 100644 GIT binary patch delta 696 zcmV;p0!RIh)B}pt1F*mb0o${|21OYMc%y<*Rk&BP4IrmU0pGK=Y3DKpa|ToeO_QOV zCkf(Aa5`l1o+rGs(VT|@0bR3MpT7zr`!E2159?GVoI00Fl57my`PAacbiPOFYZ*ee zs9q1YShG2*Qv(%(3ru|8NY<;J=q12m+yGy_3RDH-lcB8>6?C=_maWS?qyW$1P8p$Q z=81!_zw@)nt(OlG1v0u_-Y@=!&Ye&^yXq0ve3Nm#OC2T8;ZE|5X6EXHu)lFka60z! zo+pL0TXENY9vGdo*}c~SMWVW0pH+vCwB^tC#0_uj3>Uv{#JK{x{Ov`seBv3N2i96! zQ6VqO?wyjW3s)3cDCyd|eG4!ChBS3h9CI@fma72tZ1uDCz(NfNroj3Qv3MS{KF)9w z9e3V|z<1SOb1&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