浏览代码

Remove fall-through logic and separate idf_version checks of esp32 and esp8266. Also warn if idf_version is below the supported range.

ccrause 3 年之前
父节点
当前提交
985e8d3d13
共有 1 个文件被更改,包括 16 次插入6 次删除
  1. 16 6
      compiler/pmodules.pas

+ 16 - 6
compiler/pmodules.pas

@@ -415,12 +415,22 @@ implementation
 {$pop}
 {$pop}
 {$ifdef XTENSA}
 {$ifdef XTENSA}
         if not(current_module.is_unit) and (target_info.system=system_xtensa_freertos) then
         if not(current_module.is_unit) and (target_info.system=system_xtensa_freertos) then
-          if (current_settings.controllertype=ct_esp32) and (idf_version>=40200) then
-            AddUnit('espidf_40200')
-          else if (current_settings.controllertype=ct_esp8266) and (idf_version>30300) then
-            AddUnit('esp8266rtos_30400')
-          else
-            AddUnit('esp8266rtos_30300');
+          if (current_settings.controllertype=ct_esp32) then
+            begin
+              if idf_version>=40200 then
+                AddUnit('espidf_40200')
+              else
+                Comment(V_Warning, 'Unsupported esp-idf version');
+            end
+          else if (current_settings.controllertype=ct_esp8266) then
+            begin
+              if idf_version=30300 then
+                AddUnit('esp8266rtos_30300')
+              else if idf_version>=30400 then
+                AddUnit('esp8266rtos_30400')
+              else
+                Comment(V_Warning, 'Unsupported esp-rtos version');
+            end;
 {$endif XTENSA}
 {$endif XTENSA}
       end;
       end;