My Project 1
Yet another Wii Balance Board Driver
|
Functions for handling specific commands to the Wii Balance Board. More...
Functions | |
void | handle_status (WiiBalanceBoard *board) |
Processes sending a status command to the Wii Balance Board. More... | |
void | handle_calibration (WiiBalanceBoard *board) |
Processes sending a calibration command to the Wii Balance Board. More... | |
void | handle_led_on (WiiBalanceBoard *board) |
Processes sending an LED on command to the Wii Balance Board. More... | |
void | handle_activation (WiiBalanceBoard *board) |
Processes sending an activation command to the Wii Balance Board. More... | |
void | handle_data_dump (WiiBalanceBoard *board) |
Processes sending a data dump command (continous report of readings) to the Wii Balance Board. More... | |
Functions for handling specific commands to the Wii Balance Board.
These functions individually handle specific commands for the Wii Balance Board, such as status checks, calibration, LED control, and activation. Each function is called when its corresponding flag in the WiiBalanceBoard
structure is set.
While these commands are currently implemented as separate functions, they could potentially be unified into a single, generic handle_send_command
function in the future. This separation was initially implemented to manage any specific cases or exceptions as outlined in Wiimote
on Wiibrew
, which I must admit, I did not fully understand.
If it continues to be straightforward, these functions can later be consolidated to streamline the code and remove redundancy.
void handle_activation | ( | WiiBalanceBoard * | board | ) |
Processes sending an activation command to the Wii Balance Board.
This function is called when the needActivation
flag is set, and sends the corresponding activation command to the board.
board | Pointer to the WiiBalanceBoard structure that holds the current status. |
void handle_calibration | ( | WiiBalanceBoard * | board | ) |
Processes sending a calibration command to the Wii Balance Board.
This function is called when the needCalibration
flag is set, and sends the corresponding calibration command to the board.
board | Pointer to the WiiBalanceBoard structure that holds the current status. |
void handle_data_dump | ( | WiiBalanceBoard * | board | ) |
Processes sending a data dump command (continous report of readings) to the Wii Balance Board.
This function is called when the needDumpStart
flag is set, and starts the continuous transmission of board data.
board | Pointer to the WiiBalanceBoard structure that holds the current status. |
void handle_led_on | ( | WiiBalanceBoard * | board | ) |
Processes sending an LED on command to the Wii Balance Board.
This function is called when the LED flag led
is not set, and turns on the board's LED.
board | Pointer to the WiiBalanceBoard structure that holds the current status. |
void handle_status | ( | WiiBalanceBoard * | board | ) |
Processes sending a status command to the Wii Balance Board.
This function is called when the needStatus
flag is set, and sends the corresponding status command to the board.
board | Pointer to the WiiBalanceBoard structure that holds the current status. |