You are on page 1of 2

AUDIO BOARD MODULE

Handles audio board events and functionality


MODULE VARIABLES
MyPriority

ES_Framwork priority

InitAudioBoard
Parameters:
priority number of this service
Returns:
success/failure
Local Variables: Pseudo-code:
Takes a priority number, returns True
Post Event ES_Init to AudioBoard queue
Return success/failure
PostAudioBoard
Parameters:
Returns:
Local Variables: Pseudo-code:
ES_PostToService
Return success/failure
RunAudio
Parameters:
Returns:
Local Variables:

ThisEvent
ReturnEvent
ReturnEvent
AcceptWeather

Event we are handling


ES_NO_EVENT if no errors
ES_Event to return
Whether were ready for a weather event

Pseudo-code:
The EventType
Set a static variable AcceptWeather equal to True
IF AcceptWeather is True
Switch ThisEvent
ThisEvent is ES_Init
Write Play Off to the shift register
ThisEvent is WAITING
Write Play Instructions to the shift register
ThisEvent is START
Write Play Off to the shift register
Initialize the audio timer for the audio time
Set AcceptWeather to False
ThisEvent is WEATHER
IF ThisEvent Param is SPRING
Write Play Spring to the shift register
Initialize the audio timer for the audio time
Set AcceptWeather to False
ELSE IF ThisEvent Param is SUMMER
Write Play Summer to the shift register
Initialize the audio timer for the audio time

Set AcceptWeather to False


ELSE IF ThisEvent Param is FALL
Write Play Fall to the shift register
Initialize the audio timer for the audio time
Set AcceptWeather to False
ELSE IF ThisEvent Param is WINTER
Write Play Winter to the shift register
Initialize the audio timer for the audio time
Set AcceptWeather to False
END IF
ThisEvent is REPLAY
Write Play New Year to shift register
Initialize the audio timer for two seconds
Set AcceptWeather to False
ThisEvent is ES_TIMEOUT and ThisEvent Param is AUDIO_TIMER
Write Play Off to the shift register
Set AcceptWeather to True
END Switch
Endif

You might also like