comparison service/iot2/esp32_main/start_nim/main.c @ 1528:44aae4efedf6

an attempt as ESP-IDF build (doesn't work) calling a nim-generated main function (also doesn't work) Ignore-this: d43cda6cf70930a20864cae066f11739 darcs-hash:570daf34e2a97e07b7ce2eec412daa5f648445ba
author drewp <drewp@bigasterisk.com>
date Thu, 23 Jan 2020 23:46:34 -0800
parents
children
comparison
equal deleted inserted replaced
1527:ed3d29eb989a 1528:44aae4efedf6
1 #include <stdio.h>
2 #include "sdkconfig.h"
3 #include "freertos/FreeRTOS.h"
4 #include "freertos/task.h"
5 #include "esp_system.h"
6 #include "esp_spi_flash.h"
7
8 extern void NimMain();
9
10 void app_main(void)
11 {
12 printf("Hello world!\n");
13
14 /* Print chip information */
15 esp_chip_info_t chip_info;
16 esp_chip_info(&chip_info);
17 printf("This is %s chip with %d CPU cores, WiFi%s%s, ",
18 CONFIG_IDF_TARGET,
19 chip_info.cores,
20 (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
21 (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
22
23 printf("silicon revision %d, ", chip_info.revision);
24
25 printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
26 (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
27
28
29 printf("now nimmain, etc\n");
30 fflush(stdout);
31
32 NimMain();
33 }