SSD1306_SETCONTRAST, 0x7F, // contrast level 127
SSD1306_SETPRECHARGE, 0xF1, // pre-charge period (1, 15)
SSD1306_SETVCOMDETECT, 0x40, // vcomh regulator level-
- // SSD1306_DISPLAYALLON_RESUME,
- SSD1306_DISPLAYALLON,
+ SSD1306_DISPLAYALLON_RESUME,
SSD1306_NORMALDISPLAY,
SSD1306_DISPLAYON,
};
LL_I2C_ClearFlag_ADDR(I2C2);
display_send_byte(0x00); // Will send a command
display_send_byte(cmd);
+ while (!LL_I2C_IsActiveFlag_TXE(I2C2))
+ ;
LL_I2C_GenerateStopCondition(I2C2);
}
static void display_data_end(void)
{
+ while (!LL_I2C_IsActiveFlag_TXE(I2C2))
+ ;
LL_I2C_GenerateStopCondition(I2C2);
}
void display_counter(uint cnt)
{
-#if 0
byte d[5];
for (uint i=0; i<5; i++)
{
}
display_data_end();
}
-#endif
}