Skip to content

Commit

Permalink
use updated gossamer typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
joeycastillo committed Oct 5, 2024
1 parent 2808fdc commit 997f091
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion watch-library/hardware/watch/watch_extint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions watch-library/hardware/watch/watch_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion watch-library/shared/watch/watch_extint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/// @}
12 changes: 6 additions & 6 deletions watch-library/shared/watch/watch_rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
*/
Expand Down

0 comments on commit 997f091

Please sign in to comment.