Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Bo co Lab 3

Yu cu ca Lab 3:

S dng hm khi ng h thng

To dynamic task queues

Gii thiu v interrupt v ISR

Gii thiu v hardware timing function

Gii thiu v nhp d liu qua keypad

M rng v UML cho cc tnh nng mi

Task Control Block

lab ny cc task s c np vo Queues nn cc trng ca TCB bao gm 4 trng :


struct MyStruct
{
void (*myTask)(void*);
void* taskDataPtr;
struct MyStruct* next;
struct MyStruct* prev;
};
typedef struct MyStruct TCB;

Data Structure:D liu ca Lab ny gm c


cc
MeasureData

ComputeData

temperatureBuf

temperatureBuf

flowRateBuf

flowRateBuf

carbonLevelBuf

carbonLevelBuf

salinityLevelBuf

salinityLevelBuf

tempCorrected

flowRateCorrected

carbonLevelCorrected

salinityLevelCorrected

DisplayData

WarningAlarmData

tempCorrected

temperatureBuf

flowRateCorrected

flowRateBuf

carbonLevelCorrected

carbonLevelBuf

salinityLevelCorrected

salinityLevelBuf

batteryState

batteryState

Keypad status and data

Local Comms status and data

Task Queue
Trong Lab ny thay v dng task Schedule th cc task s c sp xp vo hang i
Queue.Cc task s c chn thc thi theo thut ton Round Robyn.
Task queue gm c 7 TCB:
WarningAlarmTCB;

KeypadConsoleTCB;
LocalComsTCB;
MeasureTCB;
ComputeTCB;
StatusTCB;
DisplayTCB;
Ngoi ra vic khi ng h thng s c thc hin qua task Startup.

Schedule: thi gian thc hin ca task


c quyt nh bi hardware
The following diagram is deprecated
System Time

Local
Software Delay
Time Base Reference

Global Counter

System Time Base

and replaced by the following diagram


The Software Delay must be replaced by a Hardware Timer.
System Time

Local
Hardware Timer
Time Base Reference

Global Counter

System Time Base

Usecase Diagram

Class Diagram

You might also like