mirror of https://github.com/g4klx/MMDVM.git
Simplify the OLED initialisation.
This commit is contained in:
parent
a3e0ad82e2
commit
4f3e6935d2
4
I2C3.cpp
4
I2C3.cpp
|
@ -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)
|
||||
|
|
2
I2C3.h
2
I2C3.h
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue