Skip to content

Commit 23b4976

Browse files
committed
Improved load logging
1 parent 9d80f8b commit 23b4976

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/MCP23008T/MCP23008T.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,28 @@ class MCP23008T {
260260
*/
261261
inline uint32_t readGPIO() { return regGPIO.read(); }
262262

263-
static constexpr uint_fast8_t LOG_STRING_SIZE = 3 + 5 + 2 + (3 * 2) + 1;
263+
static constexpr uint_fast8_t LOG_STRING_SIZE =
264+
3 + 5 + 2 + ((6 + 3) * 2) + 1;
264265
/**
265266
* @brief Get at string that describes the current state of the actuator
266267
* @returns the current state of the actuator as a string
267268
*/
268269
etl::string<LOG_STRING_SIZE> getLogString() {
269270
etl::string<LOG_STRING_SIZE> logString(TAG); // 3 chars
270-
(void)logString.append(": @ox"); // 5 chars
271+
(void)logString.append(": @0x"); // 5 chars
271272

272273
etl::format_spec format2;
273274
(void)format2.hex().width(2).fill('0'); // [2 chars]
274275
etl::to_string(getAddress(), logString, format2, true); // 2 chars
276+
(void)logString.append(", IC: "); // 6 chars
275277

276278
etl::format_spec format3;
277279
(void)format3.hex().width(3).fill('0'); // [3 chars]
278280
etl::to_string(readIntCap(), logString, format3, true); // 3 chars
281+
(void)logString.append(", IF: "); // 6 chars
279282
etl::to_string(readIntFlag(), logString, format3, true); // 3 chars
283+
(void)logString.append(", IO: "); // 6 chars
284+
etl::to_string(readGPIO(), logString, format3, true); // 3 chars
280285

281286
return logString;
282287
}

0 commit comments

Comments
 (0)