and one more doubt can i use flexcan library and freertos library both together because when i am trying to use i am getting errors in flexcan library
In file included from C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\Wire/Wire.h:26,
from .pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:40,
from src\main.cpp:3:
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\Wire/WireIMXRT.h: In member function 'TWBRemulation& TWBRemulation:
perator=(int)':
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\Wire/WireIMXRT.h:205:48: warning: unused parameter 'val' [-Wunused-parameter]
205 | inline TWBRemulation & operator = (int val) __attribute__((always_inline)) {
| ~~~~^~~
In file included from C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy-ts\teensy4/Stream.h:24,
from C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy-ts\teensy4/HardwareSerial.h:115,
from .pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:36:
C:/Users/ADMIN/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src/common/ArduinoFiles.h: In instantiation of 'class PrintFile<FsBaseFile>':
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src/SdFat.h:495:23: required from here
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy-ts\teensy4/Print.h:61:24: warning: 'virtual size_t Print::write(const uint8_t*, size_t)' was hidden [-Woverloaded-virtual=]
61 | virtual size_t write(const uint8_t *buffer, size_t size);
| ^~~~~
In file included from C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src/ExFatLib/ExFatFile.h:821,
from C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src/ExFatLib/ExFatVolume.h:27,
from C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src/ExFatLib/ExFatLib.h:27,
from C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src/SdFat.h:35,
from .pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:49:
C:/Users/ADMIN/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src/common/ArduinoFiles.h:53:10: note: by 'PrintFile<FsBaseFile>::write'
53 | size_t write(uint8_t b) {
| ^~~~~
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\ExFatLib\ExFatPartition.cpp: In member function 'bool ExFatPartition::init(FsBlockDevice*, uint32_t, uint32_t)':
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\ExFatLib\ExFatPartition.cpp:327:78: warning: unused parameter 'numSectors' [-Wunused-parameter]
327 | bool ExFatPartition::init(FsBlockDevice* dev, uint32_t firstSector, uint32_t numSectors) {
| ~~~~~~~~~^~~~~~~~~~
In file included from src\main.cpp:4:
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h: In member function 'virtual bool CANListener::frameHandler(CAN_message_t&, int, uint8_t)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:313:47: warning: unused parameter 'frame' [-Wunused-parameter]
313 | virtual bool frameHandler (CAN_message_t &frame, int mailbox, uint8_t controller) { return false; }
| ~~~~~~~~~~~~~~~^~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:313:58: warning: unused parameter 'mailbox' [-Wunused-parameter]
313 | virtual bool frameHandler (CAN_message_t &frame, int mailbox, uint8_t controller) { return false; }
| ~~~~^~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:313:75: warning: unused parameter 'controller' [-Wunused-parameter]
313 | virtual bool frameHandler (CAN_message_t &frame, int mailbox, uint8_t controller) { return false; }
| ~~~~~~~~^~~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h: In member function 'virtual void CANListener::txHandler(int, uint8_t)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:314:33: warning: unused parameter 'mailbox' [-Wunused-parameter]
314 | virtual void txHandler (int mailbox, uint8_t controller) {;} /* unused in Collin's library */
| ~~~~^~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:314:50: warning: unused parameter 'controller' [-Wunused-parameter]
314 | virtual void txHandler (int mailbox, uint8_t controller) {;} /* unused in Collin's library */
| ~~~~~~~~^~~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h: At global scope:
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:534:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
534 | volatile bool fifo_filter_match(uint32_t id);
| ^~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:536:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
536 | volatile void frame_distribution(CAN_message_t &msg);
| ^~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:539:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
539 | volatile bool filter_match(FLEXCAN_MAILBOX mb_num, uint32_t id);
| ^~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h: In member function 'uint8_t FlexCAN_T4<_bus, _rxSize, _txSize>::setRFFN(uint8_t)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:488:72: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
488 | uint8_t setRFFN(uint8_t rffn) { return setRFFN((FLEXCAN_RFFN_TABLE)constrain(rffn, 0, 15)); }
| ^~~~~~~~~
In file included from .pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:561:
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp: In member function 'void FlexCAN_T4<_bus, _rxSize, _txSize>::mailboxStatus()':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:272:20: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
272 | Serial.println(constrain((uint8_t)(FLEXCANb_MAXMB_SIZE(_bus) - remaining_mailboxes), 0, 32));
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:311:55: error: 'HEX' was not declared in this scope; did you mean 'arduino::HEX'?
311 | Serial.print("(ID: 0x"); Serial.print(id, HEX); Serial.print(")");
| ^~~
| arduino::HEX
.pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:192:26: note: 'arduino::HEX' declared here
192 | static constexpr uint8_t HEX { 16 };
| ^~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:368:53: error: 'HEX' was not declared in this scope; did you mean 'arduino::HEX'?
368 | Serial.print("(ID: 0x"); Serial.print(id, HEX); Serial.print(")");
| ^~~
| arduino::HEX
.pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:192:26: note: 'arduino::HEX' declared here
192 | static constexpr uint8_t HEX { 16 };
| ^~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp: In member function 'void FlexCAN_T4<_bus, _rxSize, _txSize>::setMaxMB(uint8_t)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:447:10: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
447 | last = constrain(last,1,64);
| ^~~~~~~~~
Archiving .pio\build\teensy40\lib854\libSPI.a
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp: In member function 'uint8_t FlexCAN_T4<_bus, _rxSize, _txSize>::setRFFN(FLEXCAN_RFFN_TABLE)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:1384:10: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
1384 | return constrain((uint8_t)(FLEXCANb_MAXMB_SIZE(_bus) - remaining_mailboxes), 0, 32);
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp: At global scope:
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:1505:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
1505 | FCTP_FUNC volatile bool FCTP_OPT::fifo_filter_match(uint32_t id) {
| ^~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:1524:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
1524 | FCTP_FUNC volatile bool FCTP_OPT::filter_match(FLEXCAN_MAILBOX mb_num, uint32_t id) {
| ^~~~~~~~
Compiling .pio\build\teensy40\lib7eb\SdFat\FatLib\FatFileLFN.cpp.o
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:1703:11: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
1703 | FCTP_FUNC volatile void FCTP_OPT::frame_distribution(CAN_message_t &msg) {
| ^~~~~~~~
Compiling .pio\build\teensy40\lib7eb\SdFat\FatLib\FatFilePrint.cpp.o
In file included from .pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:564:
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp: In member function 'uint8_t FlexCAN_T4FD<_bus, _rxSize, _txSize>::setRegions(uint8_t)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:95:8: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
95 | if ( constrain(size, 8, 64) == 8 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:98:13: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
98 | else if ( constrain(size, 16, 64) == 16 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:102:13: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
102 | else if ( constrain(size, 32, 64) == 32 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp: In member function 'uint8_t FlexCAN_T4FD<_bus, _rxSize, _txSize>::setRegions(uint8_t, uint8_t)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:118:8: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
118 | if ( constrain(mbdsr0, 8, 64) == 8 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:121:13: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
121 | else if ( constrain(mbdsr0, 16, 64) == 16 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:125:13: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
125 | else if ( constrain(mbdsr0, 32, 64) == 32 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:133:8: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
133 | if ( constrain(mbdsr1, 8, 64) == 8 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:136:13: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
136 | else if ( constrain(mbdsr1, 16, 64) == 16 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:140:13: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
140 | else if ( constrain(mbdsr1, 32, 64) == 32 ) {
| ^~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp: In member function 'void FlexCAN_T4FD<_bus, _rxSize, _txSize>::mailboxStatus()':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:810:53: error: 'HEX' was not declared in this scope; did you mean 'arduino::HEX'?
810 | Serial.print("(ID: 0x"); Serial.print(id, HEX); Serial.print(")");
| ^~~
| arduino::HEX
.pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:192:26: note: 'arduino::HEX' declared here
192 | static constexpr uint8_t HEX { 16 };
| ^~~
In file included from .pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:565:
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FDTimings.tpp: In member function 'bool FlexCAN_T4FD<_bus, _rxSize, _txSize>::setBaudRate(CANFD_timings_t, uint8_t, uint8_t, FLEXCAN_RXTX, bool)':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FDTimings.tpp:285:59: error: 'HEX' was not declared in this scope; did you mean 'arduino::HEX'?
285 | if ( advanced ) Serial.println(FLEXCANb_CTRL1(_bus),HEX);
| ^~~
| arduino::HEX
.pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:192:26: note: 'arduino::HEX' declared here
192 | static constexpr uint8_t HEX { 16 };
| ^~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FDTimings.tpp:287:57: error: 'HEX' was not declared in this scope; did you mean 'arduino::HEX'?
287 | if ( advanced ) Serial.println(FLEXCANb_CBT(_bus),HEX);
| ^~~
| arduino::HEX
.pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:192:26: note: 'arduino::HEX' declared here
192 | static constexpr uint8_t HEX { 16 };
| ^~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FDTimings.tpp:289:60: error: 'HEX' was not declared in this scope; did you mean 'arduino::HEX'?
289 | if ( advanced ) Serial.println(FLEXCANb_FDCBT(_bus) ,HEX);
| ^~~
| arduino::HEX
.pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:192:26: note: 'arduino::HEX' declared here
192 | static constexpr uint8_t HEX { 16 };
| ^~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FDTimings.tpp:291:61: error: 'HEX' was not declared in this scope; did you mean 'arduino::HEX'?
291 | if ( advanced ) Serial.println(FLEXCANb_FDCTRL(_bus) ,HEX);
| ^~~
| arduino::HEX
.pio\libdeps\teensy40\freertos-teensy\src/arduino_freertos.h:192:26: note: 'arduino::HEX' declared here
192 | static constexpr uint8_t HEX { 16 };
| ^~~
src\main.cpp: In function 'void task1(void*)':
src\main.cpp:34:18: warning: unused parameter 'pvParameters' [-Wunused-parameter]
34 | void task1(void *pvParameters)
| ~~~~~~^~~~~~~~~~~~
src\main.cpp: In function 'void task2(void*)':
src\main.cpp:48:18: warning: unused parameter 'pvParameters' [-Wunused-parameter]
48 | void task2(void *pvParameters)
| ~~~~~~^~~~~~~~~~~~
src\main.cpp: In function 'void task3(void*)':
src\main.cpp:76:18: warning: unused parameter 'pvParameters' [-Wunused-parameter]
76 | void task3(void *pvParameters)
| ~~~~~~^~~~~~~~~~~~
Indexing .pio\build\teensy40\lib854\libSPI.a
Compiling .pio\build\teensy40\lib7eb\SdFat\FatLib\FatFileSFN.cpp.o
Compiling .pio\build\teensy40\lib7eb\SdFat\FatLib\FatFormatter.cpp.o
Compiling .pio\build\teensy40\lib7eb\SdFat\FatLib\FatName.cpp.o
Compiling .pio\build\teensy40\lib7eb\SdFat\FatLib\FatPartition.cpp.o
Compiling .pio\build\teensy40\lib7eb\SdFat\FatLib\FatVolume.cpp.o
Compiling .pio\build\teensy40\lib7eb\SdFat\FreeStack.cpp.o
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h: In instantiation of 'int FlexCAN_T4<_bus, _rxSize, _txSize>::write(const CANFD_message_t&) [with CAN_DEV_TABLE _bus = CAN2; FLEXCAN_RXQUEUE_TABLE _rxSize = RX_SIZE_256; FLEXCAN_TXQUEUE_TABLE _txSize = TX_SIZE_16; CANFD_message_t = CANFD_message_t]':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:484:9: required from here
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:484:38: warning: unused parameter 'msg' [-Wunused-parameter]
484 | int write(const CANFD_message_t &msg) { return 0; } /* to satisfy base class for external pointers */
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
Compiling .pio\build\teensy40\lib7eb\SdFat\FsLib\FsFile.cpp.o
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h: In instantiation of 'int FlexCAN_T4<_bus, _rxSize, _txSize>::write(const CANFD_message_t&) [with CAN_DEV_TABLE _bus = CAN1; FLEXCAN_RXQUEUE_TABLE _rxSize = RX_SIZE_256; FLEXCAN_TXQUEUE_TABLE _txSize = TX_SIZE_16; CANFD_message_t = CANFD_message_t]':
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:484:9: required from here
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.h:484:38: warning: unused parameter 'msg' [-Wunused-parameter]
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp: At global scope:
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4FD.tpp:402:13: warning: 'void flexcan_isr_can3fd()' defined but not used [-Wunused-function]
402 | static void flexcan_isr_can3fd() {
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:1127:13: warning: 'void flexcan_isr_can3()' defined but not used [-Wunused-function]
1127 | static void flexcan_isr_can3() {
| ^~~~~~~~~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:1123:13: warning: 'void flexcan_isr_can2()' defined but not used [-Wunused-function]
1123 | static void flexcan_isr_can2() {
| ^~~~~~~~~~~~~~~~
.pio\libdeps\teensy40\FlexCAN_T4/FlexCAN_T4.tpp:1119:13: warning: 'void flexcan_isr_can1()' defined but not used [-Wunused-function]
1119 | static void flexcan_isr_can1() {
| ^~~~~~~~~~~~~~~~
Compiling .pio\build\teensy40\lib7eb\SdFat\FsLib\FsNew.cpp.o
*** [.pio\build\teensy40\src\main.cpp.o] Error 1
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\FatLib\FatFormatter.cpp: In function 'const uint8_t* initFatDirCallback(uint32_t, void*)':
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\FatLib\FatFormatter.cpp:90:52: warning: unused parameter 'sector' [-Wunused-parameter]
90 | static const uint8_t * initFatDirCallback(uint32_t sector, void *context) {
| ~~~~~~~~~^~~~~~
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\FatLib\FatPartition.cpp: In static member function 'static void FatPartition::freeClusterCount_cb_fat16(uint32_t, uint8_t*, void*)':
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\FatLib\FatPartition.cpp:337:55: warning: unused parameter 'sector' [-Wunused-parameter]
337 | void FatPartition::freeClusterCount_cb_fat16(uint32_t sector, uint8_t *buf, void *context) {
| ~~~~~~~~~^~~~~~
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\FatLib\FatPartition.cpp: In static member function 'static void FatPartition::freeClusterCount_cb_fat32(uint32_t, uint8_t*, void*)':
C:\Users\ADMIN\.platformio\packages\framework-arduinoteensy\libraries\SdFat\src\FatLib\FatPartition.cpp:350:55: warning: unused parameter 'sector' [-Wunused-parameter]
350 | void FatPartition::freeClusterCount_cb_fat32(uint32_t sector, uint8_t *buf, void *context) {
| ~~~~~~~~~^~~~~~