CHANGE: added struct storing current position
This commit is contained in:
parent
dd7fca18ec
commit
ece7ecf905
@ -33,7 +33,14 @@ namespace floatpump{
|
|||||||
// Move Cursor
|
// Move Cursor
|
||||||
void LCDSetCursor(uint8_t x, uint8_t y);
|
void LCDSetCursor(uint8_t x, uint8_t y);
|
||||||
|
|
||||||
|
// Position
|
||||||
|
typedef struct {
|
||||||
|
uint8_t x;
|
||||||
|
uint8_t y;
|
||||||
|
} pos_t;
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
pos_t getPosition();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
I2C_HandleTypeDef m_handle;
|
I2C_HandleTypeDef m_handle;
|
||||||
@ -46,7 +53,7 @@ namespace floatpump{
|
|||||||
bool m_autoShift{};
|
bool m_autoShift{};
|
||||||
bool m_powered;
|
bool m_powered;
|
||||||
|
|
||||||
uint8_t m_posx, m_posy;
|
pos_t m_curPos;
|
||||||
|
|
||||||
void m_lcdSendData(char data);
|
void m_lcdSendData(char data);
|
||||||
void m_lcdSendCmnd(char cmnd);
|
void m_lcdSendCmnd(char cmnd);
|
||||||
|
@ -77,8 +77,7 @@ namespace floatpump {
|
|||||||
m_incrementDecrement = true;
|
m_incrementDecrement = true;
|
||||||
m_autoShift = false;
|
m_autoShift = false;
|
||||||
|
|
||||||
m_posx = 0;
|
m_curPos = {0, 0};
|
||||||
m_posy = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCD_I2C_Driver::LCDSendCString(char *str) {
|
void LCD_I2C_Driver::LCDSendCString(char *str) {
|
||||||
@ -148,8 +147,7 @@ namespace floatpump {
|
|||||||
m_lcdSendCmnd(( 0x80 | addr));
|
m_lcdSendCmnd(( 0x80 | addr));
|
||||||
HAL_Delay(1);
|
HAL_Delay(1);
|
||||||
|
|
||||||
m_posx = x;
|
m_curPos = {x, y};
|
||||||
m_posy = y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // floatpump
|
} // floatpump
|
Loading…
Reference in New Issue
Block a user