@@ -102,6 +102,15 @@ class drvOutputBase : public drvBase {
102102 // noop
103103 }
104104
105+ /* !
106+ @brief Enables or disables the backlight on a character LCD.
107+ @param enable_backlight
108+ True to enable the backlight, False to disable it.
109+ */
110+ void EnableBackLightCharLCD (bool enable_backlight) {
111+ // noop
112+ }
113+
105114 /* !
106115 @brief Writes a message to the LCD.
107116 @param write_char_lcd
@@ -110,10 +119,8 @@ class drvOutputBase : public drvBase {
110119 */
111120 bool
112121 WriteMessageCharLCD (wippersnapper_i2c_output_CharLCDWrite *write_char_lcd) {
122+ EnableBackLightCharLCD (write_char_lcd->enable_backlight );
113123 WriteMessage (write_char_lcd->message );
114- // NOTE: While this isn't calling any other funcs in here and ret'ing true,
115- // I want to keep this function high-level for when we implement backlight
116- // color and scrolling.
117124 return true ;
118125 }
119126
@@ -126,42 +133,6 @@ class drvOutputBase : public drvBase {
126133 // noop
127134 }
128135
129- /* !
130- @brief High-level fn, executes a call to the appropriate driver
131- function(s) based on the message data type to write.
132- @param msg_backpack_write
133- Pointer to a wippersnapper_i2c_output_LedBackpackWrite message.
134- @returns True if the message was written successfully, False otherwise.
135- */
136- bool LedBackpackWrite (
137- wippersnapper_i2c_output_LedBackpackWrite *msg_backpack_write) {
138- // Check if we should adjust brightness
139- if (msg_backpack_write->adjust_brightness )
140- SetLedBackpackBrightness ((uint8_t )msg_backpack_write->brightness );
141-
142- // Write the message to a LED backpack
143- switch (msg_backpack_write->which_message ) {
144- case wippersnapper_i2c_output_LedBackpackWrite_text_tag:
145- WS_DEBUG_PRINTLN (" [i2c] Writing text to LED backpack..." );
146- WriteMessage (msg_backpack_write->message .text );
147- break ;
148- case wippersnapper_i2c_output_LedBackpackWrite_number_int_tag:
149- WS_DEBUG_PRINTLN (" [i2c] Writing int to LED backpack..." );
150- WriteValue (msg_backpack_write->message .number_int );
151- break ;
152- case wippersnapper_i2c_output_LedBackpackWrite_number_float_tag:
153- WS_DEBUG_PRINTLN (" [i2c] Writing float to LED backpack..." );
154- WriteValue (msg_backpack_write->message .number_float );
155- break ;
156- default :
157- WS_DEBUG_PRINTLN (" [i2c] ERROR: Unable to determine LED backpack "
158- " message type!" );
159- return false ;
160- break ;
161- }
162- return true ;
163- }
164-
165136protected:
166137};
167138#endif // DRV_OUTPUT_BASE_H
0 commit comments