consistently use _t convention

This commit is contained in:
joeycastillo 2024-09-29 07:45:24 -04:00
parent 01f1008e16
commit 9bedee8e54
3 changed files with 17 additions and 17 deletions

View File

@ -64,7 +64,7 @@ static bool clock_should_set_leading_zero(movement_settings_t *settings) {
return clock_is_in_24h_mode(settings) && settings->bit.clock_24h_leading_zero; return clock_is_in_24h_mode(settings) && settings->bit.clock_24h_leading_zero;
} }
static void clock_indicate(WatchIndicatorSegment indicator, bool on) { static void clock_indicate(watch_indicator_t indicator, bool on) {
if (on) { if (on) {
watch_set_indicator(indicator); watch_set_indicator(indicator);
} else { } else {

View File

@ -150,7 +150,7 @@ void watch_display_string(char *string, uint8_t position) {
} }
} }
void watch_display_text(WatchDisplayLocation location, char *string) { void watch_display_text(watch_position_t location, char *string) {
switch (location) { switch (location) {
case WATCH_POSITION_TOP_LEFT: case WATCH_POSITION_TOP_LEFT:
watch_display_character(string[0], 0); watch_display_character(string[0], 0);
@ -204,7 +204,7 @@ void watch_display_text(WatchDisplayLocation location, char *string) {
} }
} }
void watch_display_text_with_fallback(WatchDisplayLocation location, char *string, char *fallback) { void watch_display_text_with_fallback(watch_position_t location, char *string, char *fallback) {
#ifdef USE_CUSTOM_LCD #ifdef USE_CUSTOM_LCD
(void)fallback; (void)fallback;
@ -286,14 +286,14 @@ void watch_clear_decimal_if_available(void) {
#endif #endif
} }
void watch_set_indicator(WatchIndicatorSegment indicator) { void watch_set_indicator(watch_indicator_t indicator) {
uint32_t value = IndicatorSegments[indicator]; uint32_t value = IndicatorSegments[indicator];
uint8_t com = SLCD_COMNUM(value); uint8_t com = SLCD_COMNUM(value);
uint8_t seg = SLCD_SEGNUM(value); uint8_t seg = SLCD_SEGNUM(value);
watch_set_pixel(com, seg); watch_set_pixel(com, seg);
} }
void watch_clear_indicator(WatchIndicatorSegment indicator) { void watch_clear_indicator(watch_indicator_t indicator) {
uint32_t value = IndicatorSegments[indicator]; uint32_t value = IndicatorSegments[indicator];
uint8_t com = SLCD_COMNUM(value); uint8_t com = SLCD_COMNUM(value);
uint8_t seg = SLCD_SEGNUM(value); uint8_t seg = SLCD_SEGNUM(value);

View File

@ -47,7 +47,7 @@
#define SLCD_SEGNUM(segid) ((segid)&0xFF) #define SLCD_SEGNUM(segid) ((segid)&0xFF)
/// An enum listing the icons and indicators available on the watch. /// An enum listing the icons and indicators available on the watch.
typedef enum WatchIndicatorSegment { typedef enum {
WATCH_INDICATOR_SIGNAL = 0, ///< The hourly signal indicator; also useful for indicating that sensors are on. WATCH_INDICATOR_SIGNAL = 0, ///< The hourly signal indicator; also useful for indicating that sensors are on.
WATCH_INDICATOR_BELL, ///< The small bell indicating that an alarm is set. WATCH_INDICATOR_BELL, ///< The small bell indicating that an alarm is set.
WATCH_INDICATOR_PM, ///< The PM indicator, indicating that a time is in the afternoon. WATCH_INDICATOR_PM, ///< The PM indicator, indicating that a time is in the afternoon.
@ -57,10 +57,10 @@ typedef enum WatchIndicatorSegment {
// These next indicators are only available on the new custom LCD: // These next indicators are only available on the new custom LCD:
WATCH_INDICATOR_BATTERY, ///< The battery indicator. Will fall back to the LAP icon on the original F-91W LCD. WATCH_INDICATOR_BATTERY, ///< The battery indicator. Will fall back to the LAP icon on the original F-91W LCD.
WATCH_INDICATOR_SLEEP, ///< The sleep indicator. No fallback here; use the tick animation to indicate sleep. WATCH_INDICATOR_SLEEP, ///< The sleep indicator. No fallback here; use the tick animation to indicate sleep.
} WatchIndicatorSegment; } watch_indicator_t;
/// An enum listing the locations on the display where text can be placed. /// An enum listing the locations on the display where text can be placed.
typedef enum WatchDisplayLocation { typedef enum {
WATCH_POSITION_FULL = 0, ///< Display 10 characters to the full screen, in the standard F-91W layout. WATCH_POSITION_FULL = 0, ///< Display 10 characters to the full screen, in the standard F-91W layout.
WATCH_POSITION_TOP_LEFT, ///< Display 2 or 3 characters in the top left of the screen. WATCH_POSITION_TOP_LEFT, ///< Display 2 or 3 characters in the top left of the screen.
WATCH_POSITION_TOP_RIGHT, ///< Display 2 digits in the top right of the screen. WATCH_POSITION_TOP_RIGHT, ///< Display 2 digits in the top right of the screen.
@ -68,7 +68,7 @@ typedef enum WatchDisplayLocation {
WATCH_POSITION_HOURS, ///< Display 2 characters in the hours portion of the main line. WATCH_POSITION_HOURS, ///< Display 2 characters in the hours portion of the main line.
WATCH_POSITION_MINUTES, ///< Display 2 characters in the minutes portion of the main line. WATCH_POSITION_MINUTES, ///< Display 2 characters in the minutes portion of the main line.
WATCH_POSITION_SECONDS, ///< Display 2 characters in the seconds portion of the main line. WATCH_POSITION_SECONDS, ///< Display 2 characters in the seconds portion of the main line.
} WatchDisplayLocation; } watch_position_t;
/** @brief Enables the Segment LCD display. /** @brief Enables the Segment LCD display.
* Call this before attempting to set pixels or display strings. * Call this before attempting to set pixels or display strings.
@ -108,10 +108,10 @@ void watch_display_string(char *string, uint8_t position) __attribute__ ((deprec
/** /**
* @brief Displays a string at the provided location. * @brief Displays a string at the provided location.
* @param location @see WatchDisplayLocation, the location where you wish to display the string. * @param location @see watch_position_t, the location where you wish to display the string.
* @param string A null-terminated string with two characters to display. * @param string A null-terminated string with two characters to display.
*/ */
void watch_display_text(WatchDisplayLocation location, char *string); void watch_display_text(watch_position_t location, char *string);
/** /**
* @brief Displays a string at the provided location on the new LCD, with a fallback for the original. * @brief Displays a string at the provided location on the new LCD, with a fallback for the original.
@ -154,7 +154,7 @@ void watch_display_text(WatchDisplayLocation location, char *string);
* *
* Needless to say, some fine-tuning may be necessary to get the best results on both displays. * Needless to say, some fine-tuning may be necessary to get the best results on both displays.
*/ */
void watch_display_text_with_fallback(WatchDisplayLocation location, char *string, char *fallback); void watch_display_text_with_fallback(watch_position_t location, char *string, char *fallback);
/** @brief Turns the colon segment on. /** @brief Turns the colon segment on.
*/ */
@ -175,17 +175,17 @@ void watch_set_decimal_if_available(void);
void watch_clear_decimal_if_available(void); void watch_clear_decimal_if_available(void);
/** @brief Sets an indicator on the LCD. Use this to turn on one of the indicator segments. /** @brief Sets an indicator on the LCD. Use this to turn on one of the indicator segments.
* @param indicator One of the indicator segments from the enum. @see WatchIndicatorSegment * @param indicator One of the indicator segments from the enum. @see watch_indicator_t
*/ */
void watch_set_indicator(WatchIndicatorSegment indicator); void watch_set_indicator(watch_indicator_t indicator);
/** @brief Clears an indicator on the LCD. Use this to turn off one of the indicator segments. /** @brief Clears an indicator on the LCD. Use this to turn off one of the indicator segments.
* @param indicator One of the indicator segments from the enum. @see WatchIndicatorSegment * @param indicator One of the indicator segments from the enum. @see watch_indicator_t
*/ */
void watch_clear_indicator(WatchIndicatorSegment indicator); void watch_clear_indicator(watch_indicator_t indicator);
/** @brief Clears all indicator segments. /** @brief Clears all indicator segments.
* @see WatchIndicatorSegment * @see watch_indicator_t
*/ */
void watch_clear_all_indicators(void); void watch_clear_all_indicators(void);