earlephilhower / arduino-pico

Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
GNU Lesser General Public License v2.1
2.03k stars 423 forks source link

Compile error if FreeRTOS.h is included before Arduino.h #2287

Closed yoursunny closed 3 months ago

yoursunny commented 3 months ago

Sketch

#include <FreeRTOS.h>
#include <Arduino.h>

void setup() {
}

void loop() {
}

Compile Error

In file included from C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/CoreMutex.h:27,
                 from C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/SerialUART.h:27,
                 from C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/Arduino.h:120,
                 from C:\Users\sunny\AppData\Local\Temp\.arduinoIDE-unsaved2024620-7888-7ekz15.yv45u\sketch_jul20a\sketch_jul20a.ino:2:
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:43:12: error: 'SemaphoreHandle_t' does not name a type; did you mean 'xSemaphoreHandle'?
   43 |     extern SemaphoreHandle_t __freertos_mutex_create() __attribute__((weak));
      |            ^~~~~~~~~~~~~~~~~
      |            xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:44:12: error: 'SemaphoreHandle_t' does not name a type; did you mean 'xSemaphoreHandle'?
   44 |     extern SemaphoreHandle_t _freertos_recursive_mutex_create() __attribute__((weak));
      |            ^~~~~~~~~~~~~~~~~
      |            xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:46:17: error: variable or field '__freertos_mutex_take' declared void
   46 |     extern void __freertos_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                 ^~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:46:39: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   46 |     extern void __freertos_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                       ^~~~~~~~~~~~~~~~~
      |                                       xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:46:82: error: attributes after parenthesized initializer ignored [-fpermissive]
   46 |     extern void __freertos_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                                                  ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:48:16: warning: '__freertos_mutex_take_from_isr' initialized and declared 'extern'
   48 |     extern int __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:48:47: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   48 |     extern int __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                               ^~~~~~~~~~~~~~~~~
      |                                               xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:48:80: error: expected primary-expression before '*' token
   48 |     extern int __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                                                                ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:48:82: error: 'pxHigherPriorityTaskWoken' was not declared in this scope
   48 |     extern int __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:48:129: error: attributes after parenthesized initializer ignored [-fpermissive]
   48 |     extern int __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                                                                                                                 ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:48:129: error: expression list treated as compound expression in initializer [-fpermissive]
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:49:16: warning: '__freertos_mutex_try_take' initialized and declared 'extern'
   49 |     extern int __freertos_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:49:42: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   49 |     extern int __freertos_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                          ^~~~~~~~~~~~~~~~~
      |                                          xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:49:85: error: attributes after parenthesized initializer ignored [-fpermissive]
   49 |     extern int __freertos_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                                                     ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:50:17: error: variable or field '__freertos_mutex_give' declared void
   50 |     extern void __freertos_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
      |                 ^~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:50:39: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   50 |     extern void __freertos_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                       ^~~~~~~~~~~~~~~~~
      |                                       xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:50:82: error: attributes after parenthesized initializer ignored [-fpermissive]
   50 |     extern void __freertos_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                                                  ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:51:17: error: variable or field '__freertos_mutex_give_from_isr' declared void
   51 |     extern void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:51:48: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   51 |     extern void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                                ^~~~~~~~~~~~~~~~~
      |                                                xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:51:81: error: expected primary-expression before '*' token
   51 |     extern void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                                                                 ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:51:83: error: 'pxHigherPriorityTaskWoken' was not declared in this scope
   51 |     extern void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:51:130: error: attributes after parenthesized initializer ignored [-fpermissive]
   51 |     extern void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
      |                                                                                                                                  ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:53:17: error: variable or field '__freertos_recursive_mutex_take' declared void
   53 |     extern void __freertos_recursive_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:53:49: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   53 |     extern void __freertos_recursive_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                 ^~~~~~~~~~~~~~~~~
      |                                                 xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:53:92: error: attributes after parenthesized initializer ignored [-fpermissive]
   53 |     extern void __freertos_recursive_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                                                            ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:54:16: warning: '__freertos_recursive_mutex_try_take' initialized and declared 'extern'
   54 |     extern int __freertos_recursive_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:54:52: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   54 |     extern int __freertos_recursive_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                    ^~~~~~~~~~~~~~~~~
      |                                                    xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:54:95: error: attributes after parenthesized initializer ignored [-fpermissive]
   54 |     extern int __freertos_recursive_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                                                               ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:55:17: error: variable or field '__freertos_recursive_mutex_give' declared void
   55 |     extern void __freertos_recursive_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:55:49: error: 'SemaphoreHandle_t' was not declared in this scope; did you mean 'xSemaphoreHandle'?
   55 |     extern void __freertos_recursive_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                 ^~~~~~~~~~~~~~~~~
      |                                                 xSemaphoreHandle
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:55:92: error: attributes after parenthesized initializer ignored [-fpermissive]
   55 |     extern void __freertos_recursive_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
      |                                                                                            ^
C:\Users\sunny\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.9.3\cores\rp2040/_freertos.h:60:8: error: 'SemaphoreHandle_t' does not name a type; did you mean 'xSemaphoreHandle'?
   60 | extern SemaphoreHandle_t __get_freertos_mutex_for_ptr(mutex_t *m, bool recursive = false);
      |        ^~~~~~~~~~~~~~~~~
      |        xSemaphoreHandle

exit status 1

Compilation error: exit status 1