summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-06-18 16:52:13 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-06-18 16:52:13 +0200
commit2592974e1022e00aa2f46aa4751bc51c7a62784a (patch)
tree6f9fe84d64534b1f68c79cf9dd35bc294aa34da5
parent19a7beddb11f852c00d2b98f7177d83047ed3178 (diff)
downloadmodern-esp-sandbox-2592974e1022e00aa2f46aa4751bc51c7a62784a.tar.gz
modern-esp-sandbox-2592974e1022e00aa2f46aa4751bc51c7a62784a.tar.bz2
modern-esp-sandbox-2592974e1022e00aa2f46aa4751bc51c7a62784a.tar.xz
modern-esp-sandbox-2592974e1022e00aa2f46aa4751bc51c7a62784a.zip
o Reformat.
-rw-r--r--ota-test/main/main.cpp19
-rw-r--r--ota-test/main/misc.c52
2 files changed, 37 insertions, 34 deletions
diff --git a/ota-test/main/main.cpp b/ota-test/main/main.cpp
index 08b2c2e..506c24f 100644
--- a/ota-test/main/main.cpp
+++ b/ota-test/main/main.cpp
@@ -14,7 +14,8 @@ uint32_t user_rf_cal_sector_set();
extern "C"
void user_init();
-static void set_wifi_mode() {
+static void set_wifi_mode()
+{
if (wifi_get_opmode_default() != NULL_MODE) {
printf("Setting default station mode");
wifi_set_opmode(NULL_MODE);
@@ -23,7 +24,8 @@ static void set_wifi_mode() {
wifi_set_opmode_current(NULL_MODE);
}
-void main_task(void* ctx) {
+void main_task(void *ctx)
+{
(void) ctx;
int count = 0;
@@ -39,7 +41,8 @@ void main_task(void* ctx) {
#define THREAD_PRIO 8
TaskHandle_t main_task_handle;
-void user_init() {
+void user_init()
+{
os_printf("SDK version: %s, free: %d, app build: %s\n", system_get_sdk_version(), system_get_free_heap_size(), __TIMESTAMP__);
uint8_t current_rom = rboot_get_current_rom();
@@ -72,14 +75,14 @@ extern "C"
uint8_t default_config(rboot_config *romconf, uint32_t flashsize);
uint8_t default_config(rboot_config *romconf, uint32_t flashsize) {
- romconf->count = 2;
- romconf->roms[0] = SECTOR_SIZE * (BOOT_CONFIG_SECTOR + 1);
- romconf->roms[1] = (flashsize / 2) + (SECTOR_SIZE * (BOOT_CONFIG_SECTOR + 1));
+ romconf->count = 2;
+ romconf->roms[0] = SECTOR_SIZE * (BOOT_CONFIG_SECTOR + 1);
+ romconf->roms[1] = (flashsize / 2) + (SECTOR_SIZE * (BOOT_CONFIG_SECTOR + 1));
#ifdef BOOT_GPIO_ENABLED
- romconf->mode = MODE_GPIO_ROM;
+ romconf->mode = MODE_GPIO_ROM;
#endif
#ifdef BOOT_GPIO_SKIP_ENABLED
- romconf->mode = MODE_GPIO_SKIP;
+ romconf->mode = MODE_GPIO_SKIP;
#endif
}
*/
diff --git a/ota-test/main/misc.c b/ota-test/main/misc.c
index 1b5119b..31655a5 100644
--- a/ota-test/main/misc.c
+++ b/ota-test/main/misc.c
@@ -18,32 +18,32 @@ uint32_t user_rf_cal_sector_set()
uint32_t rf_cal_sec = 0;
switch (size_map) {
- case FLASH_SIZE_4M_MAP_256_256:
- rf_cal_sec = 128 - 5;
- break;
-
- case FLASH_SIZE_8M_MAP_512_512:
- rf_cal_sec = 256 - 5;
- break;
-
- case FLASH_SIZE_16M_MAP_512_512:
- case FLASH_SIZE_16M_MAP_1024_1024:
- rf_cal_sec = 512 - 5;
- break;
-
- case FLASH_SIZE_32M_MAP_512_512:
- case FLASH_SIZE_32M_MAP_1024_1024:
- rf_cal_sec = 1024 - 5;
- break;
- case FLASH_SIZE_64M_MAP_1024_1024:
- rf_cal_sec = 2048 - 5;
- break;
- case FLASH_SIZE_128M_MAP_1024_1024:
- rf_cal_sec = 4096 - 5;
- break;
- default:
- rf_cal_sec = 0;
- break;
+ case FLASH_SIZE_4M_MAP_256_256:
+ rf_cal_sec = 128 - 5;
+ break;
+
+ case FLASH_SIZE_8M_MAP_512_512:
+ rf_cal_sec = 256 - 5;
+ break;
+
+ case FLASH_SIZE_16M_MAP_512_512:
+ case FLASH_SIZE_16M_MAP_1024_1024:
+ rf_cal_sec = 512 - 5;
+ break;
+
+ case FLASH_SIZE_32M_MAP_512_512:
+ case FLASH_SIZE_32M_MAP_1024_1024:
+ rf_cal_sec = 1024 - 5;
+ break;
+ case FLASH_SIZE_64M_MAP_1024_1024:
+ rf_cal_sec = 2048 - 5;
+ break;
+ case FLASH_SIZE_128M_MAP_1024_1024:
+ rf_cal_sec = 4096 - 5;
+ break;
+ default:
+ rf_cal_sec = 0;
+ break;
}
return rf_cal_sec;