Skip to content

Commit 1b42fba

Browse files
Added an alternate app_main needed for an espidf project
1 parent 93208b8 commit 1b42fba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/main.cpp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ void TestHeap(uint32_t Id)
139139
LOG_PORT.println(String(" Heap After: ") + ESP.getFreeHeap());
140140
}
141141

142+
#ifdef CREATE_APP_MAIN
143+
extern "C" void app_main()
144+
{
145+
initArduino();
146+
setup();
147+
while (true)
148+
{
149+
loop();
150+
}
151+
}
152+
#endif // def CREATE_APP_MAIN
153+
142154
#ifdef ARDUINO_ARCH_ESP32
143155
void esp_alloc_failed_hook_callback(size_t requested_size, uint32_t caps, const char *function_name)
144156
{

0 commit comments

Comments
 (0)