* Xtensa FreeRTOS: unified haltproc

git-svn-id: trunk@46679 -
This commit is contained in:
florian 2020-08-24 21:02:09 +00:00
parent 03a0e6e82f
commit c73c98d995
2 changed files with 11 additions and 6 deletions

View File

@ -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: $'); if operatingsystem_result <> 0 then
printdword(operatingsystem_result); writeln('Runtime error ', operatingsystem_result);
printpchar(#10);
while true do writeln('_haltproc called, exit code: ',operatingsystem_result);
esp_deep_sleep_start; 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;

View File

@ -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