clean up
This commit is contained in:
1 parent
6ee14d6a93
commit
5476d0729a
4 files changed
+14
-18
No files matched your search
+2
-15
@@ -16,9 +16,6 @@
|
||||
#define ARDUINO_MAIN
|
||||
#include "Arduino.h"
|
||||
|
||||
#define DBG_MEM_INFO 0
|
||||
#define DBG_MEM_INFO_INTERVAL 60000
|
||||
|
||||
// DEBUG Level 1
|
||||
#if CFG_DEBUG
|
||||
// weak function to avoid compilation error with
|
||||
@@ -61,23 +58,13 @@ static void loop_task(void* arg)
|
||||
{
|
||||
loop();
|
||||
|
||||
#ifdef NRF52840_XXAA
|
||||
#ifdef NRF52840_XXAA
|
||||
tud_cdc_write_flush();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Serial events
|
||||
if (serialEvent && serialEventRun) serialEventRun();
|
||||
|
||||
#if CFG_DEBUG >= 2 && DBG_MEM_INFO
|
||||
static uint32_t meminfo_ms = 0;
|
||||
if (meminfo_ms + DBG_MEM_INFO_INTERVAL < millis())
|
||||
{
|
||||
meminfo_ms += millis();
|
||||
Serial.printf("Memory Info (print every %d seconds)\n", DBG_MEM_INFO_INTERVAL/1000);
|
||||
dbgMemInfo();
|
||||
}
|
||||
#endif
|
||||
|
||||
// To compatible with most code where loop is not rtos-aware
|
||||
taskYIELD(); // vTaskDelay(1);
|
||||
}
|
||||
|
||||
@@ -104,8 +104,12 @@ size_t USBSerial::write(const uint8_t *buffer, size_t size)
|
||||
size -= wrcount;
|
||||
buffer += wrcount;
|
||||
|
||||
// Write FIFO is full, flush and re-write
|
||||
if ( size ) tud_cdc_write_flush();
|
||||
// Write FIFO is full, flush and re-try
|
||||
if ( size )
|
||||
{
|
||||
tud_cdc_write_flush();
|
||||
delay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,11 +34,15 @@ void setup()
|
||||
ExternalFS.begin();
|
||||
|
||||
Serial.print("Formating ...");
|
||||
Serial.println(flash_qspi_size());
|
||||
Serial.flush();
|
||||
|
||||
// Format without erase
|
||||
ExternalFS.format(true);
|
||||
// Pass true for full external flash erasing (take time)
|
||||
ExternalFS.format(false);
|
||||
|
||||
Serial.println("Done");
|
||||
Serial.flush();
|
||||
}
|
||||
|
||||
// the loop function runs over and over again forever
|
||||
|
||||
@@ -157,6 +157,7 @@ bool FatFS::format (bool eraseall)
|
||||
{
|
||||
if ( eraseall )
|
||||
{
|
||||
LOG_LV2("EFLASH", "full erasing");
|
||||
VERIFY(flash_qspi_chiperase());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user