Severson-Group / Severson-Group/docs.amdc.dev

Update the AMDC article `Tutorial: Timing & Sensors` to clarify the location of `extern unit8_t` declaration

Open Beginner friendly
#145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
1
Forks
3
Avg merge
2d 23h
Merged PRs (30d)
1

Description

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:

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked Tutorial: Timing & Sensors article and find the “Reporting Sensor Acquisition Time and Sensor Data Staleness” section. Clarify where the extern uint8_t sensor_flag declaration belongs relative to the sys/scheduler.h include, then verify the rendered tutorial makes the required placement unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.