aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-05-06 07:50:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-05-06 07:50:34 +0000
commit63a8f66d92b5d7018a4d962f4f7b23774a621771 (patch)
tree49359656bc06962f6508e5896551343842461e36 /Demos/Device
parentf11f69fd2989899b3088ea7d11b981f2d68c05e0 (diff)
downloadlufa-63a8f66d92b5d7018a4d962f4f7b23774a621771.tar.gz
lufa-63a8f66d92b5d7018a4d962f4f7b23774a621771.tar.bz2
lufa-63a8f66d92b5d7018a4d962f4f7b23774a621771.zip
Changed HWB board driver to Buttons driver, to allow for the support of future boards with more than one mounted GPIO button.
Diffstat (limited to 'Demos/Device')
-rw-r--r--Demos/Device/Joystick/Joystick.c4
-rw-r--r--Demos/Device/Joystick/Joystick.h2
-rw-r--r--Demos/Device/KeyboardMouse/KeyboardMouse.c8
-rw-r--r--Demos/Device/KeyboardMouse/KeyboardMouse.h2
-rw-r--r--Demos/Device/MIDI/MIDI.c6
-rw-r--r--Demos/Device/MIDI/MIDI.h2
-rw-r--r--Demos/Device/Mouse/Mouse.c4
-rw-r--r--Demos/Device/Mouse/Mouse.h2
8 files changed, 15 insertions, 15 deletions
diff --git a/Demos/Device/Joystick/Joystick.c b/Demos/Device/Joystick/Joystick.c
index a5c3242fe..b2de42fc2 100644
--- a/Demos/Device/Joystick/Joystick.c
+++ b/Demos/Device/Joystick/Joystick.c
@@ -58,7 +58,7 @@ int main(void)
/* Hardware Initialization */
Joystick_Init();
LEDs_Init();
- HWB_Init();
+ Buttons_Init();
/* Indicate USB not ready */
UpdateStatus(Status_USBNotReady);
@@ -173,7 +173,7 @@ bool GetNextReport(USB_JoystickReport_Data_t* ReportData)
if (JoyStatus_LCL & JOY_PRESS)
ReportData->Button = (1 << 1);
- if (HWB_GetStatus())
+ if (Buttons_GetStatus() & BUTTONS_BUTTON1)
ReportData->Button |= (1 << 0);
/* Check if the new report is different to the previous report */
diff --git a/Demos/Device/Joystick/Joystick.h b/Demos/Device/Joystick/Joystick.h
index 2a5cc2588..c274b5bc5 100644
--- a/Demos/Device/Joystick/Joystick.h
+++ b/Demos/Device/Joystick/Joystick.h
@@ -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
/* Task Definitions: */
diff --git a/Demos/Device/KeyboardMouse/KeyboardMouse.c b/Demos/Device/KeyboardMouse/KeyboardMouse.c
index dc039eec0..5c9332849 100644
--- a/Demos/Device/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/Device/KeyboardMouse/KeyboardMouse.c
@@ -240,8 +240,8 @@ TASK(USB_Keyboard)
{
uint8_t JoyStatus_LCL = Joystick_GetStatus();
- /* Check if HWB is not pressed, if so mouse mode enabled */
- if (!(HWB_GetStatus()))
+ /* Check if board button is not pressed, if so mouse mode enabled */
+ if (!(Buttons_GetStatus() & BUTTONS_BUTTON1))
{
if (JoyStatus_LCL & JOY_UP)
KeyboardReportData.KeyCode[0] = 0x04; // A
@@ -311,8 +311,8 @@ TASK(USB_Mouse)
{
uint8_t JoyStatus_LCL = Joystick_GetStatus();
- /* Check if HWB is pressed, if so mouse mode enabled */
- if (HWB_GetStatus())
+ /* Check if board button is pressed, if so mouse mode enabled */
+ if (Buttons_GetStatus() & BUTTONS_BUTTON1)
{
if (JoyStatus_LCL & JOY_UP)
MouseReportData.Y = 1;
diff --git a/Demos/Device/KeyboardMouse/KeyboardMouse.h b/Demos/Device/KeyboardMouse/KeyboardMouse.h
index a69293c41..9a1fee1f4 100644
--- a/Demos/Device/KeyboardMouse/KeyboardMouse.h
+++ b/Demos/Device/KeyboardMouse/KeyboardMouse.h
@@ -45,7 +45,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
/* Task Definitions: */
diff --git a/Demos/Device/MIDI/MIDI.c b/Demos/Device/MIDI/MIDI.c
index 7e1d21156..1323e1163 100644
--- a/Demos/Device/MIDI/MIDI.c
+++ b/Demos/Device/MIDI/MIDI.c
@@ -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);
diff --git a/Demos/Device/MIDI/MIDI.h b/Demos/Device/MIDI/MIDI.h
index 4e81c8c2a..4d801e82f 100644
--- a/Demos/Device/MIDI/MIDI.h
+++ b/Demos/Device/MIDI/MIDI.h
@@ -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: */
diff --git a/Demos/Device/Mouse/Mouse.c b/Demos/Device/Mouse/Mouse.c
index 669b576a6..7fff291f4 100644
--- a/Demos/Device/Mouse/Mouse.c
+++ b/Demos/Device/Mouse/Mouse.c
@@ -81,7 +81,7 @@ int main(void)
/* Hardware Initialization */
Joystick_Init();
LEDs_Init();
- HWB_Init();
+ Buttons_Init();
/* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
OCR0A = 0x7D;
@@ -305,7 +305,7 @@ void CreateMouseReport(USB_MouseReport_Data_t* ReportData)
if (JoyStatus_LCL & JOY_PRESS)
ReportData->Button = (1 << 0);
- if (HWB_GetStatus())
+ if (Buttons_GetStatus() & BUTTONS_BUTTON1)
ReportData->Button |= (1 << 1);
}
diff --git a/Demos/Device/Mouse/Mouse.h b/Demos/Device/Mouse/Mouse.h
index 714f8d6e8..4eaf457ca 100644
--- a/Demos/Device/Mouse/Mouse.h
+++ b/Demos/Device/Mouse/Mouse.h
@@ -50,7 +50,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
/* Task Definitions: */