]> git.earman.xyz Git - sensor-watch.git/commitdiff
clean up const qualifiers in display functions
authorjoeycastillo <joeycastillo@utexas.edu>
Sun, 29 Sep 2024 17:56:16 +0000 (13:56 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Sun, 29 Sep 2024 17:56:16 +0000 (13:56 -0400)
watch-library/shared/watch/watch_common_display.c
watch-library/shared/watch/watch_slcd.h

index 042fabf4b4cf4856717ec615c261006b1774c725..af79f554e209e51c721f3e035cb675b7f22bc1c8 100644 (file)
@@ -141,7 +141,7 @@ void watch_display_character_lp_seconds(uint8_t character, uint8_t position) {
     }
 }
 
-void watch_display_string(char *string, uint8_t position) {
+void watch_display_string(const char *string, uint8_t position) {
     size_t i = 0;
     while(string[i] != 0) {
         watch_display_character(string[i], position + i);
@@ -150,7 +150,7 @@ void watch_display_string(char *string, uint8_t position) {
     }
 }
 
-void watch_display_text(watch_position_t location, char *string) {
+void watch_display_text(watch_position_t location, const char *string) {
     switch (location) {
         case WATCH_POSITION_TOP_LEFT:
             watch_display_character(string[0], 0);
@@ -204,7 +204,7 @@ void watch_display_text(watch_position_t location, char *string) {
     }
 }
 
-void watch_display_text_with_fallback(watch_position_t location, char *string, char *fallback) {
+void watch_display_text_with_fallback(watch_position_t location, const char *string, const char *fallback) {
 #ifdef USE_CUSTOM_LCD
     (void)fallback;
 
index 07922be7644949eb1ba0dd979ceb73d6396c3195..eba6df5a7337c086bd709a3ca230dc97adcc7349 100644 (file)
@@ -104,14 +104,14 @@ void watch_clear_display(void);
   * @note This method does not clear the display; if for example you display a two-character string at
           position 0, positions 2-9 will retain whatever state they were previously displaying.
   */
-void watch_display_string(char *string, uint8_t position) __attribute__ ((deprecated("Use watch_display_text and watch_display_text_with_fallback instead.")));
+void watch_display_string(const char *string, uint8_t position) __attribute__ ((deprecated("Use watch_display_text and watch_display_text_with_fallback instead.")));
 
 /**
  * @brief Displays a string at the provided location.
  * @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.
  */
-void watch_display_text(watch_position_t location, char *string);
+void watch_display_text(watch_position_t location, const char *string);
 
 /**
  * @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(watch_position_t location, char *string);
  *
  *       Needless to say, some fine-tuning may be necessary to get the best results on both displays.
  */
-void watch_display_text_with_fallback(watch_position_t location, char *string, char *fallback);
+void watch_display_text_with_fallback(watch_position_t location, const char *string, const char *fallback);
 
 /** @brief Turns the colon segment on.
   */