diff options
author | madhogs <59648482+madhogs@users.noreply.github.com> | 2024-02-14 17:17:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-14 17:17:10 +0000 |
commit | 3c6affb4190b5d22f90eed9b3fa815c11465b8c6 (patch) | |
tree | b2d8228cf59abd63129faf9beb4d668b34b71d5e /watch-library/hardware | |
parent | 868fecd24892a8eac87f7b18034b9b6e7d403a8b (diff) | |
parent | af18673e1aa53091880d829a6fa4d7e23a6b4381 (diff) | |
download | Sensor-Watch-3c6affb4190b5d22f90eed9b3fa815c11465b8c6.tar.gz Sensor-Watch-3c6affb4190b5d22f90eed9b3fa815c11465b8c6.tar.bz2 Sensor-Watch-3c6affb4190b5d22f90eed9b3fa815c11465b8c6.zip |
Merge branch 'main' into preferences_in_config
Diffstat (limited to 'watch-library/hardware')
-rw-r--r-- | watch-library/hardware/watch/watch_buzzer.c | 1 | ||||
-rw-r--r-- | watch-library/hardware/watch/watch_rtc.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/watch-library/hardware/watch/watch_buzzer.c b/watch-library/hardware/watch/watch_buzzer.c index 18fb4db0..2dce8d23 100644 --- a/watch-library/hardware/watch/watch_buzzer.c +++ b/watch-library/hardware/watch/watch_buzzer.c @@ -23,6 +23,7 @@ */ #include "watch_buzzer.h" +#include "watch_private_buzzer.h" #include "../../../watch-library/hardware/include/saml22j18a.h" #include "../../../watch-library/hardware/include/component/tc.h" #include "../../../watch-library/hardware/hri/hri_tc_l22.h" diff --git a/watch-library/hardware/watch/watch_rtc.c b/watch-library/hardware/watch/watch_rtc.c index 881e2575..93cb9f1c 100644 --- a/watch-library/hardware/watch/watch_rtc.c +++ b/watch-library/hardware/watch/watch_rtc.c @@ -84,7 +84,7 @@ void watch_rtc_register_periodic_callback(ext_irq_cb_t callback, uint8_t frequen if (__builtin_popcount(frequency) != 1) return; // this left-justifies the period in a 32-bit integer. - uint32_t tmp = frequency << 24; + uint32_t tmp = (frequency & 0xFF) << 24; // now we can count the leading zeroes to get the value we need. // 0x01 (1 Hz) will have 7 leading zeros for PER7. 0xF0 (128 Hz) will have no leading zeroes for PER0. uint8_t per_n = __builtin_clz(tmp); @@ -99,7 +99,7 @@ void watch_rtc_register_periodic_callback(ext_irq_cb_t callback, uint8_t frequen void watch_rtc_disable_periodic_callback(uint8_t frequency) { if (__builtin_popcount(frequency) != 1) return; - uint8_t per_n = __builtin_clz(frequency << 24); + uint8_t per_n = __builtin_clz((frequency & 0xFF) << 24); RTC->MODE2.INTENCLR.reg = 1 << per_n; } |