Compilation error: APP TIMER_SCHED_EVENT_DATA SIZE was not declared

Hi

I’m following this guide, but when I try to compile my code, I’m seeing this error:

src/main.h:10:39: error: 'APP_TIMER_SCHED_EVENT_DATA_SIZE' was not declared in this scope

I found, that it is defined in app_timer.h, but I cannot include it, when included, during ‘build’ with PlatformIO this file cannot be found:

In file included from src/main.cpp:30:0:
src/main.h:5:10: fatal error: app_scheduler.h: No such file or directory

The rest of the code compiles fine, if I enter any integer there, it compiles nicely.

This is the top part of my main.h:


#include <Arduino.h>
#include <LoRaWan-RAK4630.h> //http://librarymanager/All#SX126x
#include <SPI.h>

#include "secrets.h"

#include <Adafruit_BME680.h> // Click to install library: http://librarymanager/All#Adafruit_BME680

const int OTAA = 1;                                               // OTAA is used by default.
const int SCHED_MAX_EVENT_DATA_SIZE = APP_TIMER_SCHED_EVENT_DATA_SIZE; /**< Maximum size of scheduler events. */
const int SCHED_QUEUE_SIZE = 60;                                       /**< Maximum number of events in the scheduler queue. */
const int LORAWAN_DATERATE = DR_0;                                     /*LoRaMac datarates definition, from DR_0 to DR_5*/
const int LORAWAN_TX_POWER = TX_POWER_5;                               /*LoRaMac tx power definition, from TX_POWER_0 to TX_POWER_15*/
const int JOINREQ_NBTRIALS = 3;                                        /**< Number of trials for the join request. */
const DeviceClass_t CURRENT_CLASS = CLASS_A;           
const eLoRaMacRegion_t CURRENT_REGION = LORAMAC_REGION_EU868;           /* Region:EU868*/
const lmh_confirm CURRENT_CONFIRM = LMH_UNCONFIRMED_MSG;                 /* confirm/unconfirm packet definition*/
const int PORT = LORAWAN_APP_PORT;                              /* data port*/
/**@brief Structure containing LoRaWan parameters, needed for lmh_init()
*/

Why does this define not exist here, and what should I do?
Regards

That was this line:

const int SCHED_MAX_EVENT_DATA_SIZE = APP_TIMER_SCHED_EVENT_DATA_SIZE; /**< Maximum size of scheduler events. */

It should be a define:

#define SCHED_MAX_EVENT_DATA_SIZE APP_TIMER_SCHED_EVENT_DATA_SIZE /**< Maximum size of scheduler events. */

Now it works fine.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.