mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-08-21 22:46:22 +02:00
Simplify the OLED initialisation.
This commit is contained in:
@@ -30,7 +30,7 @@ CI2C3::CI2C3()
|
||||
{
|
||||
}
|
||||
|
||||
bool CI2C3::init()
|
||||
void CI2C3::init()
|
||||
{
|
||||
// Enable I2C3
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C3, ENABLE);
|
||||
@@ -73,8 +73,6 @@ bool CI2C3::init()
|
||||
|
||||
// I2C Peripheral Enable
|
||||
I2C_Cmd(I2C3, ENABLE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t CI2C3::write(uint8_t addr, const uint8_t* data, uint16_t length)
|
||||
|
||||
@@ -33,7 +33,7 @@ class CI2C3 {
|
||||
public:
|
||||
CI2C3();
|
||||
|
||||
bool init();
|
||||
void init();
|
||||
|
||||
uint8_t write(uint8_t addr, const uint8_t* data, uint16_t length);
|
||||
|
||||
|
||||
+2
-6
@@ -313,11 +313,9 @@ m_oledBuffer(NULL)
|
||||
clear();
|
||||
}
|
||||
|
||||
bool CI2COLED::init()
|
||||
void CI2COLED::init()
|
||||
{
|
||||
bool ret = m_i2c.init();
|
||||
if (!ret)
|
||||
return false;
|
||||
m_i2c.init();
|
||||
|
||||
// Initialise the VG-6432TSWEG02 OLED display
|
||||
sendCommand(0xAEU); /*display off*/
|
||||
@@ -352,8 +350,6 @@ bool CI2COLED::init()
|
||||
sendCommand(0x8DU, 0x10U); /*set charge pump enable*/
|
||||
|
||||
sendCommand(0xAFU); /*display ON*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CI2COLED::setMode(int state)
|
||||
|
||||
Reference in New Issue
Block a user