Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BufferedSerial mbed
Fork of ESPQuickFlash by
main.cpp
- Committer:
- mbedAustin
- Date:
- 2016-04-18
- Revision:
- 1:7cb29c3c51ac
- Parent:
- 0:d84cdaf22096
File content as of revision 1:7cb29c3c51ac:
#include "mbed.h"
#include "BufferedSerial.h"
// Include the actual image
#include "flash_image.h"
// Cross include definitions
//#define DEBUG 1
#define LED_STATUS 1
DigitalOut led_blue(LED_BLUE);
DigitalOut led_green(LED_GREEN);
#include "slip.h"
#include "esp_command.h"
int main() {
ESPCommand<BufferedSerial> esp(D1, D0, PTC6); // Change PTC6 to user button on your platform
led_blue = 1;
led_green = 1;
for (int i = 0; i < FLASH_COUNT; i++) {
if (!esp.flash_write(
FLASH_PAGES[i].address,
FLASH_PAGES[i].data,
FLASH_PAGES[i].size))
error("Error writing flash at 0x%05x!\r\n", FLASH_PAGES[i].address);
}
// Signal we're done
printf("Finished\r\n");
while (true) {
led_green = !led_green; // toggle led
wait(0.2f);
}
}
