@@ -102,6 +102,15 @@ class drvOutputBase : public drvBase {
102
102
// noop
103
103
}
104
104
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
+
105
114
/* !
106
115
@brief Writes a message to the LCD.
107
116
@param write_char_lcd
@@ -110,10 +119,8 @@ class drvOutputBase : public drvBase {
110
119
*/
111
120
bool
112
121
WriteMessageCharLCD (wippersnapper_i2c_output_CharLCDWrite *write_char_lcd) {
122
+ EnableBackLightCharLCD (write_char_lcd->enable_backlight );
113
123
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.
117
124
return true ;
118
125
}
119
126
@@ -126,42 +133,6 @@ class drvOutputBase : public drvBase {
126
133
// noop
127
134
}
128
135
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
-
165
136
protected:
166
137
};
167
138
#endif // DRV_OUTPUT_BASE_H
0 commit comments