Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Topics:
1. Review lab2
2. Lab 3 overview
- Design a system to state of the art environmental monitoring and analysis system is to be designed and developed. - The following specification elaborates the requirements for the display and alarm portion of the system.
With: - Input: from a number of sensors that are used to collect data from various points in a localized geographic area. - Output: display on screen and alarm if out of range.
The system is decomposed into the major
{
void (*myTask)(void*); void* taskDataPtr; }; typedef struct MyStruct TCB;
- The first member is a pointer to a function taking: measure, Compute, Display, warning - The second member is a void* pointer which is used to reference the shared data for the task.
variables - MeasureData: temperatureRaw, flowRateRaw, - ComputeData: temperatureRaw, flowRateRaw, tempCorrected, flowRateCorrected, - DisplayData: tempCorrected, flowRateCorrected, - WarningAlarmData: temperatureRaw, batteryState, - Status: batteryState. Comprising a set of tasks that are executed, in turn, forever.
you defined above and call each of the functions in turn. queue[i] = &task
while(1)
{
aTCBPtr = queue[var]; aTCBPtr -> myTask(aTCBPtr ->taskDataPtr); var = (var+1)%5;
GPIO_PORTF_DATA_R ^= 0x01;
}
Lab 3 overview(1)
Develop: the system must be portable, low power,
Lab 3 overview(2)
Requirements:
- Add a task scheduler will support and manage dynamic task creation and deletion. - The OLED display subsystem will be modified and extended. - The display function on the console OLED to a local terminal connected to the system via a serial RS-232 link. - The system will incorporate a keypad in support of user entered data such as choose some task.
Lab 3 overview(3)
OLED display be extended: full name and data of temperature, flowrate, salitinylevel, carbonlevel, batterystate. Such information is to be presented on a series of lights on the front panel such as: if everythings okay, green LED on board will turn on. Add Startup& Keypad Task: Modify the system start up. Local Keypad: control of the system (use interrupt). Local Serial Communications: . Specified data, status, warning, and alarm information shall be formatted as an RS-232 serial data stream and sent from the processors serial port to a local computer by PuTTY.
Lab 3 overview(4)
A C declaration for such a TCB:
struct MyStruct { void (*myTask)(void*); void* taskDataPtr; // delete temperatureRaw and replace with temperatureRawBuf[8] in measuredata struct MyStruct* next; struct MyStruct* prev; }; typedef struct MyStruct TCB;
With: the third and fourth members are pointers to the next and previous TCBs in a doubly linked list data structure.
Lab 3 overview(5)
Add 3 tasks:
- Keypad: Keypad status and data - Schedule - LocalComs: Local Comms status and data Seven of the TCB elements in the queue correspond to tasks, Measure, Compute, Display, KeypadConsole, LocalComs, Warning-Alarm, and Status and one to the dynamically scheduled Start. Change some function.