1 /* 2 No except example. 3 4 This example code is in the Public Domain (or CC0 licensed, at your option.) 5 6 Unless required by applicable law or agreed to in writing, this 7 software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 CONDITIONS OF ANY KIND, either express or implied. 9 */ 10 11 #include "esp_system.h" 12 #include <new> 13 #include "freertos/FreeRTOS.h" 14 #include "freertos/task.h" 15 app_main()16extern "C" void app_main() 17 { 18 char *char_array = new (std::nothrow) char [47]; 19 20 for (int i = 10; i >= 0; i--) { 21 char_array[i] = i; 22 vTaskDelay(1000 / portTICK_PERIOD_MS); 23 } 24 esp_restart(); 25 26 delete [] char_array; 27 } 28