Changed HWB board driver to Buttons driver, to allow for the support of future boards with more than one mounted GPIO button.
This commit is contained in:
1 parent
f11f69fd29
commit
63a8f66d92
25 files changed
+163
-131
No files matched your search
@@ -58,7 +58,7 @@ int main(void)
|
||||
/* Hardware Initialization */
|
||||
Joystick_Init();
|
||||
LEDs_Init();
|
||||
HWB_Init();
|
||||
Buttons_Init();
|
||||
|
||||
/* Indicate USB not ready */
|
||||
UpdateStatus(Status_USBNotReady);
|
||||
@@ -134,8 +134,8 @@ TASK(USB_MIDI_Task)
|
||||
uint8_t JoystickStatus = Joystick_GetStatus();
|
||||
uint8_t JoystickChanges = (JoystickStatus ^ PrevJoystickStatus);
|
||||
|
||||
/* Get HWB status - if set use channel 10 (percussion), otherwise use channel 1 */
|
||||
uint8_t Channel = ((HWB_GetStatus()) ? MIDI_CHANNEL(10) : MIDI_CHANNEL(1));
|
||||
/* Get board button status - if pressed use channel 10 (percussion), otherwise use channel 1 */
|
||||
uint8_t Channel = ((Buttons_GetStatus() & BUTTONS_BUTTON1) ? MIDI_CHANNEL(10) : MIDI_CHANNEL(1));
|
||||
|
||||
if (JoystickChanges & JOY_LEFT)
|
||||
SendMIDINoteChange(0x3C, (JoystickStatus & JOY_LEFT), 0, Channel);
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
|
||||
#include <LUFA/Drivers/Board/Joystick.h> // Joystick driver
|
||||
#include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
|
||||
#include <LUFA/Drivers/Board/HWB.h> // Hardware Button driver
|
||||
#include <LUFA/Drivers/Board/Buttons.h> // Board Buttons driver
|
||||
#include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
|
||||
|
||||
/* Macros: */
|
||||
|
||||
Reference in new issue
Block a user