OLED: better device presence check

This commit is contained in:
King Kévin 2018-04-02 20:38:59 +02:00
parent 5fa6a58e9b
commit 72c3fc8677
1 changed files with 3 additions and 0 deletions

View File

@ -42,6 +42,9 @@
bool oled_ssd1306_setup(void)
{
if (!i2c_master_check_signals(OLED_SSD1306_I2C)) { // check if there are pull-ups to operator I2C
return false;
}
i2c_master_setup(OLED_SSD1306_I2C, 400); // setup I2C bus ( SSD1306 supports an I2C cleck up to 400 kHz)
const uint8_t oled_init[] = {
0x00, // control byte: continuous (multiple byes), command