-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Context
Related Issues / PRs:
- Timing Manager Tutorial #112
- Edit timing manager tutorial #114
- Edit timing manager tutorial #123
- Fix typo in timing & sensors tutorial #136
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
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:
