make sure to clear the OLED

This commit is contained in:
Skot Croshere 2023-05-12 13:05:08 -04:00
parent 3a0a33b195
commit c78f5b04c8
4 changed files with 14 additions and 1 deletions

View File

@ -8,7 +8,7 @@
"interface/ftdi/esp32_devkitj_v1.cfg",
"target/esp32s3.cfg"
],
"idf.port": "/dev/cu.usbserial-1464301",
"idf.port": "/dev/cu.usbserial-1464401",
"idf.pythonBinPath": "/Users/skot/.espressif/python_env/idf4.4_py3.9_env/bin/python",
"idf.toolsPath": "/Users/skot/.espressif",
"files.associations": {

View File

@ -261,6 +261,10 @@ int OLED_fill(uint8_t ucData) {
return 0;
}
void OLED_clear(void) {
OLED_fill(0x00);
}
int OLED_clearLine(uint8_t line) {
uint8_t temp[128];

View File

@ -47,5 +47,6 @@ int OLED_setPixel(int x, int y, uint8_t ucPixel);
bool OLED_setContrast(uint8_t ucContrast);
int OLED_clearLine(uint8_t);
bool OLED_status(void);
void OLED_clear(void);
#endif // OLED96_H

View File

@ -12,6 +12,8 @@
#include "adc.h"
#include "oled.h"
#define USE_OLED 1 //Set to 1 to use OLED, 0 to not use it
static const char *TAG = "system";
void init_system(void) {
@ -40,9 +42,15 @@ void init_system(void) {
vTaskDelay(500 / portTICK_RATE_MS);
//oled
#ifdef USE_OLED
if (!OLED_init()) {
ESP_LOGI(TAG, "OLED init failed!");
} else {
ESP_LOGI(TAG, "OLED init success!");
OLED_clear();
OLED_writeString(0, 0, "The bitaxe!");
}
#endif
}
void get_stats(void) {