From acff67c718db99e1e5b3825c3879fff62394cf8e Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 20 Jan 2017 15:56:33 +0900 Subject: [PATCH] AP_Notify: Display_SH1106 command stucture clarification renaming the elements of the structure makes their purpose more clear --- libraries/AP_Notify/Display_SH1106_I2C.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Notify/Display_SH1106_I2C.cpp b/libraries/AP_Notify/Display_SH1106_I2C.cpp index 33ce132d87..5f9ad85065 100644 --- a/libraries/AP_Notify/Display_SH1106_I2C.cpp +++ b/libraries/AP_Notify/Display_SH1106_I2C.cpp @@ -86,8 +86,10 @@ void Display_SH1106_I2C::_timer() struct PACKED { uint8_t reg; - uint8_t cmd[3]; - } command = { 0x0, {0x02 /* |= column[0:3] */, 0x10 /* |= column[4:7] */, 0xB0 /* |= page */} }; + uint8_t column_0_3; + uint8_t column_4_7; + uint8_t page; + } command = { 0x0, 0x2, 0x10, 0xB0 }; struct PACKED { uint8_t reg; @@ -96,7 +98,7 @@ void Display_SH1106_I2C::_timer() // write buffer to display for (uint8_t i = 0; i < (SH1106_ROWS / SH1106_ROWS_PER_PAGE); i++) { - command.cmd[2] = 0xB0 | (i & 0x0F); + command.page = 0xB0 | (i & 0x0F); _dev->transfer((uint8_t *)&command, sizeof(command), nullptr, 0); memcpy(&display_buffer.db[0], &_displaybuffer[i * SH1106_COLUMNS], SH1106_COLUMNS/2);