You are on page 1of 1

Main program

Initialization:
Board, Priority, etc

Initialization:
Task, Queue,
Semaphore.

Task 1 Task 2
Initialization Initialization

No No Yes
External
EXTI 5 EXTI 4 EXTI 12
Interrupt?

1 2
Yes Yes Yes light cluster
Receive Queue

Take Mutex Take Mutex Take Mutex

UARTprintf()
green light 21s red light 24s

No No No
Flag!=RESET Flag!=RESET Flag!=RESET

yellow 3s green light 21s Delay(50)


Yes Yes Yes

1 2 1 2 1 2
light cluster light cluster light cluster
red light 24s yellow 3s

Delay(1000) Delay(1000)
red light: ON green light: ON yellow light: ON yellow light: ON green light: ON red light: ON

Send Queue Send Queue Send Queue

Give Mutex Give Mutex Give Mutex

You might also like