diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2022-01-04 15:38:42 -0500 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2022-01-04 15:38:42 -0500 |
commit | c5ecf1dabdc66818892f37f37bf75cb39d93b5f7 (patch) | |
tree | dd054cdb73b1dee7f4c34f43f50b2711fec35f8e /watch-library | |
parent | 16ac7534c4f5f0b13c2609c26a139e6df3139170 (diff) | |
parent | 311cfdb5f45cab25053d7a188a2eb30e2c5e781b (diff) | |
download | Sensor-Watch-c5ecf1dabdc66818892f37f37bf75cb39d93b5f7.tar.gz Sensor-Watch-c5ecf1dabdc66818892f37f37bf75cb39d93b5f7.tar.bz2 Sensor-Watch-c5ecf1dabdc66818892f37f37bf75cb39d93b5f7.zip |
Merge branch 'main' of https://github.com/joeycastillo/Sensor-Watch into main
Diffstat (limited to 'watch-library')
-rw-r--r-- | watch-library/watch/watch.c | 4 | ||||
-rw-r--r-- | watch-library/watch/watch.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/watch-library/watch/watch.c b/watch-library/watch/watch.c index 844ed3d9..791fd974 100644 --- a/watch-library/watch/watch.c +++ b/watch-library/watch/watch.c @@ -38,3 +38,7 @@ void SYSTEM_Handler(void) { bool watch_is_battery_low(void) { return battery_is_low; } + +bool watch_is_buzzer_or_led_enabled(void){ + return hri_mclk_get_APBCMASK_TCC0_bit(MCLK); +} diff --git a/watch-library/watch/watch.h b/watch-library/watch/watch.h index 669a5ed1..064f90ec 100644 --- a/watch-library/watch/watch.h +++ b/watch-library/watch/watch.h @@ -73,4 +73,11 @@ */ bool watch_is_battery_low(void); +/** @brief Returns true if either the buzzer or the LED driver is enabled. + * @details Both the buzzer and the LED use the TCC peripheral to drive their behavior. This function returns true if that + * peripheral is enabled. You can use this function to determine whether you need to call the watch_disable_leds or + * or watch_enable_buzzer functions before using these peripherals. + */ +bool watch_is_buzzer_or_led_enabled(void); + #endif /* WATCH_H_ */
\ No newline at end of file |