Context
Related Issues / PRs:
While @hess0297 was doing the AMDC tutorial : Create a GitHub PR that implements tutorial 6 (Timing & Sensors), we encountered the build error (type not found error) in the SDK when declaring:
extern uint8_t sensor_flag;
only if we define this on the "top" of the task_controller.h file as instructed. After some investigation, it looks like we need to define extern uint8_t sensor_flag; after #include "sys/scheduler.h in the task_controller.h, i.e., the following code works:
#ifndef TASK_CONTROLLER_H
#define TASK_CONTROLLER_H
#include "sys/scheduler.h"
#include "drv/analog.h"
extern uint8_t sensor_flag;
but the following does not work:
extern uint8_t sensor_flag;
#ifndef TASK_CONTROLLER_H
#define TASK_CONTROLLER_H
#include "sys/scheduler.h"
#include "drv/analog.h"
Looks like the extern uint8_t sensor_flag; requires to include <stdint.h>, which is actually defined in
https://github.com/Severson-Group/AMDC-Firmware/blob/6eea3d6e4e5d0a44852ddd3233975ac0039c65a8/sdk/app_cpu1/common/sys/scheduler.h#L5
and therefore, extern uint8_t sensor_flag; needed to be located after the #include "sys/scheduler.h".
Approach
Update Tutorial: Timing & Sensors article to clearly specify the location that users should put, especially this section:

Context
Related Issues / PRs:
While @hess0297 was doing the AMDC tutorial : Create a GitHub PR that implements tutorial 6 (Timing & Sensors), we encountered the build error (type not found error) in the SDK when declaring:
only if we define this on the "top" of the
task_controller.hfile as instructed. After some investigation, it looks like we need to defineextern uint8_t sensor_flag;after#include "sys/scheduler.hin thetask_controller.h, i.e., the following code works:but the following does not work:
Looks like the
extern uint8_t sensor_flag;requires to include <stdint.h>, which is actually defined inhttps://github.com/Severson-Group/AMDC-Firmware/blob/6eea3d6e4e5d0a44852ddd3233975ac0039c65a8/sdk/app_cpu1/common/sys/scheduler.h#L5
and therefore,
extern uint8_t sensor_flag;needed to be located after the#include "sys/scheduler.h".Approach
Update Tutorial: Timing & Sensors article to clearly specify the location that users should put, especially this section: