]> git.earman.xyz Git - sensor-watch.git/commitdiff
use updated gossamer typedefs
authorjoeycastillo <joeycastillo@utexas.edu>
Sat, 5 Oct 2024 14:26:05 +0000 (10:26 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Sat, 5 Oct 2024 14:36:58 +0000 (10:36 -0400)
watch-library/hardware/watch/watch_extint.c
watch-library/hardware/watch/watch_rtc.c
watch-library/shared/watch/watch_extint.h
watch-library/shared/watch/watch_rtc.h

index 9a77d2b56702efaaaaafd299f28ccb9b7c480bec..9c07baabe0384e28ba48b382ea4f8dc31716d30b 100644 (file)
@@ -41,7 +41,7 @@ void watch_disable_external_interrupts(void) {
     eic_disable();
 }
 
-void watch_register_interrupt_callback(const uint8_t pin, watch_cb_t callback, eic_interrupt_trigger trigger) {
+void watch_register_interrupt_callback(const uint8_t pin, watch_cb_t callback, eic_interrupt_trigger_t trigger) {
     watch_enable_digital_input(pin);
 
     // check if this is a button pin
index 8d3a897a5b333cb625aba540bfd7652bc59392eb..66fd4ebe56762665bd3094c50d6e8639ad990e03 100644 (file)
@@ -48,11 +48,11 @@ void _watch_rtc_init(void) {
     rtc_configure_callback(watch_rtc_callback);
 }
 
-void watch_rtc_set_date_time(rtc_date_time date_time) {
+void watch_rtc_set_date_time(rtc_date_time_t date_time) {
     rtc_set_date_time(date_time);
 }
 
-rtc_date_time watch_rtc_get_date_time(void) {
+rtc_date_time_t watch_rtc_get_date_time(void) {
     return rtc_get_date_time();
 }
 
@@ -96,7 +96,7 @@ void watch_rtc_disable_all_periodic_callbacks(void) {
     watch_rtc_disable_matching_periodic_callbacks(0xFF);
 }
 
-void watch_rtc_register_alarm_callback(watch_cb_t callback, rtc_date_time alarm_time, rtc_alarm_match mask) {
+void watch_rtc_register_alarm_callback(watch_cb_t callback, rtc_date_time_t alarm_time, rtc_alarm_match_t mask) {
     RTC->MODE2.Mode2Alarm[0].ALARM.reg = alarm_time.reg;
     RTC->MODE2.Mode2Alarm[0].MASK.reg = mask;
     RTC->MODE2.INTENSET.reg = RTC_MODE2_INTENSET_ALARM0;
index df8ffaae1b9468ceafd92874a9bbb3b829d73ec8..68ef29aeea4d33685b22e90ea54f64d129360ea0 100644 (file)
@@ -65,6 +65,6 @@ void watch_disable_external_interrupts(void);
   *       will allow them to trigger even when the watch is in deep sleep mode.
   * @warning Pin A2 shares an interrupt channel with the Alarm button; use caution when configuring both.
   */
-void watch_register_interrupt_callback(const uint8_t pin, watch_cb_t callback, eic_interrupt_trigger trigger);
+void watch_register_interrupt_callback(const uint8_t pin, watch_cb_t callback, eic_interrupt_trigger_t trigger);
 
 /// @}
index dcdbf7981bad409caa06dc0f269bbe0e301ce737..64d107fb10b7569ec0b56c9cf8adedd84f4cd635 100644 (file)
@@ -45,7 +45,7 @@ extern watch_cb_t a4_callback;
 
 #define WATCH_RTC_REFERENCE_YEAR (2020)
 
-#define watch_date_time rtc_date_time
+#define watch_date_time rtc_date_time_t
 
 /** @brief Called by main.c to check if the RTC is enabled.
   * You may call this function, but outside of app_init, it should always return true.
@@ -60,20 +60,20 @@ bool _watch_rtc_is_enabled(void);
   *       1 means 2021, 2 means 2022, etc. **You will be responsible for handling this offset in your code**,
   *       if the calendar year is needed for timestamp calculation logic or display purposes.
   */
-void watch_rtc_set_date_time(rtc_date_time date_time);
+void watch_rtc_set_date_time(rtc_date_time_t date_time);
 
 /** @brief Returns the date and time.
-  * @return A rtc_date_time with the current date and time, with a year value from 0-63 representing 2020-2083.
+  * @return A rtc_date_time_t with the current date and time, with a year value from 0-63 representing 2020-2083.
   * @see watch_rtc_set_date_time for notes about how the year is stored.
   */
-rtc_date_time watch_rtc_get_date_time(void);
+rtc_date_time_t watch_rtc_get_date_time(void);
 
 /** @brief Registers an alarm callback that will be called when the RTC time matches the target time, as masked
   *        by the provided mask.
   * @param callback The function you wish to have called when the alarm fires. If this value is NULL, the alarm
   *                 interrupt will still be enabled, but no callback function will be called.
   * @param alarm_time The time that you wish to match. The date is currently ignored.
-  * @param mask One of the values in rtc_alarm_match indicating which values to check.
+  * @param mask One of the values in rtc_alarm_match_t indicating which values to check.
   * @details The alarm interrupt is a versatile tool for scheduling events in the future, especially since it can
   *          wake the device from all sleep modes. The key to its versatility is the mask parameter.
   *          Suppose we set an alarm for midnight, 00:00:00.
@@ -83,7 +83,7 @@ rtc_date_time watch_rtc_get_date_time(void);
   *          In theory the SAM L22's alarm function can match on days, months and even years, but I have not had
   *          success with this yet; as such, I am omitting these options for now.
   */
-void watch_rtc_register_alarm_callback(watch_cb_t callback, rtc_date_time alarm_time, rtc_alarm_match mask);
+void watch_rtc_register_alarm_callback(watch_cb_t callback, rtc_date_time_t alarm_time, rtc_alarm_match_t mask);
 
 /** @brief Disables the alarm callback.
   */