浏览代码

* Xtensa FreeRTOS: unified haltproc

git-svn-id: trunk@46679 -
florian 5 年之前
父节点
当前提交
c73c98d995
共有 2 个文件被更改,包括 11 次插入6 次删除
  1. 10 5
      rtl/freertos/xtensa/esp32.pp
  2. 1 1
      rtl/freertos/xtensa/esp8266.pp

+ 10 - 5
rtl/freertos/xtensa/esp32.pp

@@ -75,11 +75,16 @@ unit esp32;
 
 
     procedure _FPC_haltproc; public name '_haltproc';noreturn;
     procedure _FPC_haltproc; public name '_haltproc';noreturn;
       begin
       begin
-        printpchar('_haltproc called, going to deep sleep, exit code: $');
-        printdword(operatingsystem_result);
-        printpchar(#10);
-        while true do
-           esp_deep_sleep_start;
+        if operatingsystem_result <> 0 then
+          writeln('Runtime error ', operatingsystem_result);
+
+        writeln('_haltproc called, exit code: ',operatingsystem_result);
+        flushOutput(TextRec(Output));
+        repeat
+          // Allow other tasks to run
+          // Do not enter deep sleep, can lead to problems with flashing
+          vTaskDelay(1000);
+        until false;
       end;
       end;
 
 
 
 

+ 1 - 1
rtl/freertos/xtensa/esp8266.pp

@@ -56,7 +56,7 @@ unit esp8266;
         if operatingsystem_result <> 0 then
         if operatingsystem_result <> 0 then
           writeln('Runtime error ', operatingsystem_result);
           writeln('Runtime error ', operatingsystem_result);
 
 
-        writeln('_haltproc called...');
+        writeln('_haltproc called, exit code: ',operatingsystem_result);
         flushOutput(TextRec(Output));
         flushOutput(TextRec(Output));
         repeat
         repeat
           // Allow other tasks to run
           // Allow other tasks to run