diff options
author | joeycastillo <joeycastillo@utexas.edu> | 2023-01-03 21:24:14 -0600 |
---|---|---|
committer | joeycastillo <joeycastillo@utexas.edu> | 2023-01-03 21:24:14 -0600 |
commit | 851d047c818dacc30c86f4d87f33247dcfb0095c (patch) | |
tree | 0c21fa65a38a899e540d369c6e178284a739afbc /watch-library | |
parent | 801230cc3ab910af73a56738f9b539597e15fa56 (diff) | |
download | Sensor-Watch-851d047c818dacc30c86f4d87f33247dcfb0095c.tar.gz Sensor-Watch-851d047c818dacc30c86f4d87f33247dcfb0095c.tar.bz2 Sensor-Watch-851d047c818dacc30c86f4d87f33247dcfb0095c.zip |
never disable buzzer output
Diffstat (limited to 'watch-library')
-rw-r--r-- | watch-library/hardware/watch/watch_buzzer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/watch-library/hardware/watch/watch_buzzer.c b/watch-library/hardware/watch/watch_buzzer.c index c06242ff..7a5f1704 100644 --- a/watch-library/hardware/watch/watch_buzzer.c +++ b/watch-library/hardware/watch/watch_buzzer.c @@ -28,6 +28,7 @@ if (!hri_tcc_get_CTRLA_reg(TCC0, TCC_CTRLA_ENABLE)) { _watch_enable_tcc(); } + gpio_set_pin_direction(BUZZER, GPIO_DIRECTION_OUT); } inline void watch_set_buzzer_period(uint32_t period) { hri_tcc_write_PERBUF_reg(TCC0, period); @@ -35,6 +36,7 @@ inline void watch_set_buzzer_period(uint32_t period) { void watch_disable_buzzer(void) { _watch_disable_tcc(); + watch_set_buzzer_off(); } inline void watch_set_buzzer_on(void) { @@ -43,8 +45,8 @@ inline void watch_set_buzzer_on(void) { } inline void watch_set_buzzer_off(void) { - gpio_set_pin_direction(BUZZER, GPIO_DIRECTION_OFF); gpio_set_pin_function(BUZZER, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_level(BUZZER, true); } void watch_buzzer_play_note(BuzzerNote note, uint16_t duration_ms) { |