Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By nazimba
#67139 Hi there! Is there any way to avoid looping function in the ESP8266 integrated?
I mean to do it in the same way that it is possible to achieve it in most of Atmel MCU, taking advantage of the speed processor.
This would be the example code and here is a link to a post on this topic on the AVR Freaks site.
http://www.avrfreaks.net/forum/attiny85 ... stead-4mhz
I hope something like this is possible.
Thanks in advance.

Code: Select allvoid setup() {
 
   pinMode(LED_BUILTIN, OUTPUT);

      while(true) { 
         digitalWrite(LED_BUILTIN, HIGH);
         digitalWrite(LED_BUILTIN, LOW);
      }
}


ERROR MESSAGE:
Archiving built core (caching) in: C:\Users\Nazim\AppData\Local\Temp\arduino_cache_248748\core\core_esp8266_esp8266_nodemcuv[code]2_CpuFrequency_80,UploadSpeed_115200,FlashSize_4M3M_08186d0190bdc8e1d53eb1574336cbab.a
C:\Users\Nazim\AppData\Local\Temp\arduino_build_799418/arduino.ar(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x4): undefined reference to `loop'

C:\Users\Nazim\AppData\Local\Temp\arduino_build_799418/arduino.ar(core_esp8266_main.cpp.o): In function `loop_wrapper':

C:\Users\Nazim\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/core_esp8266_main.cpp:110: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
User avatar
By martinayotte
#67220 Yes ! ... but I must admit that I didn't took time to read the whole thing.
I've understood that you wish to have the tightest loop to get high speed GPIO toggling.
But what else I've missed ?
The fact that you still have an empty loop() to satisfy the linker doesn't prevent you to do the while() in setup().

EDIT : (almost forgot) But beware that WiFi won't be able to run if you stuck in a while() and you will need to disable the watchdog.