diff --git a/demos/bsp/boards/board.h b/demos/bsp/boards/board.h
index 8becd677e..8ea13ade0 100644
--- a/demos/bsp/boards/board.h
+++ b/demos/bsp/boards/board.h
@@ -124,6 +124,8 @@ void board_leds(uint32_t on_mask, uint32_t off_mask);
uint8_t board_uart_getchar(void);
void board_uart_putchar(uint8_t c);
+uint32_t board_buttons(void);
+
extern volatile uint32_t system_ticks;
#ifdef __cplusplus
diff --git a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c
index 74d1451bf..675b393de 100644
--- a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c
+++ b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c
@@ -68,7 +68,6 @@ void board_init(void)
//P0_21 instead of P2_9 as USB connect
#endif
-#if CFG_UART_ENABLE
//------------- UART init -------------//
PINSEL_CFG_Type PinCfg =
@@ -91,7 +90,6 @@ void board_init(void)
UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
-#endif
}
//--------------------------------------------------------------------+
@@ -111,8 +109,6 @@ void board_leds(uint32_t on_mask, uint32_t off_mask)
//--------------------------------------------------------------------+
// UART
//--------------------------------------------------------------------+
-#if CFG_UART_ENABLE
-
void board_uart_putchar(uint8_t c)
{
UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
@@ -124,5 +120,3 @@ uint8_t board_uart_getchar(void)
}
#endif
-
-#endif
diff --git a/demos/bsp/boards/microbuilder/board_rf1ghznode.c b/demos/bsp/boards/microbuilder/board_rf1ghznode.c
index d84ec962d..28e8e3cfd 100644
--- a/demos/bsp/boards/microbuilder/board_rf1ghznode.c
+++ b/demos/bsp/boards/microbuilder/board_rf1ghznode.c
@@ -40,18 +40,39 @@
#if BOARD == BOARD_RF1GHZNODE
+#define LED_PORT (1)
+#define LED_PIN (31)
+#define LED_ON (0)
+#define LED_OFF (1)
+
+enum {
+ BOARD_BUTTON_COUNT = 1
+};
+
+const static struct {
+ uint8_t port;
+ uint8_t pin;
+} buttons[BOARD_BUTTON_COUNT] = { 0, 1 };
+
void board_init(void)
{
SystemInit();
+
+#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
SysTick_Config(SystemCoreClock / CFG_TICKS_PER_SECOND); // 1 msec tick timer
+#endif
+
GPIOInit();
- GPIOSetDir(CFG_LED_PORT, CFG_LED_PIN, 1);
+ //------------- LED -------------//
+ GPIOSetDir(LED_PORT, LED_PIN, 1);
board_leds(0x01, 0); // turn off the led first
-#if CFG_UART_ENABLE
+ //------------- BUTTON -------------//
+ for(uint8_t i=0; i
-
+
@@ -146,7 +146,7 @@
-
+
@@ -154,7 +154,7 @@
-
+
diff --git a/demos/device/device_os_none/device_os_none.uvopt b/demos/device/device_os_none/device_os_none.uvopt
new file mode 100644
index 000000000..52374ca8e
--- /dev/null
+++ b/demos/device/device_os_none/device_os_none.uvopt
@@ -0,0 +1,1805 @@
+
+
+
+ 1.0
+
+ ### uVision Project, (C) Keil Software
+
+
+ *.c
+ *.s*; *.src; *.a*
+ *.obj
+ *.lib
+ *.txt; *.h; *.inc
+ *.plm
+ *.cpp
+
+
+
+ 0
+ 0
+
+
+
+ Board EA4357
+ 0x4
+ ARM-ADS
+
+ 12000000
+
+ 1
+ 1
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\UV4Build\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 8
+
+ SARMCM3.DLL
+ -MPU
+ DCM.DLL
+ -pCM4
+ SARMCM3.DLL
+ -MPU
+ TCM.DLL
+ -pCM4
+
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1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
+ ..\..\bsp\boards\embedded_artists\ea4357\board_ea4357.c
+ board_ea4357.c
+ 0
+ 0
+
+
+ 3
+ 35
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bsp\boards\printf_retarget.c
+ printf_retarget.c
+ 0
+ 0
+
+
+ 3
+ 36
+ 1
+ 0
+ 0
+ 0
+ 0
+ 195
+ 201
+ 0
+ ..\..\bsp\boards\embedded_artists\oem_base_board\pca9532.c
+ pca9532.c
+ 0
+ 0
+
+
+ 3
+ 37
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bsp\boards\ngx\board_ngx4330.c
+ board_ngx4330.c
+ 0
+ 0
+
+
+ 3
+ 38
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bsp\boards\microbuilder\board_lpc4357usb.c
+ board_lpc4357usb.c
+ 0
+ 0
+
+
+ 3
+ 39
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bsp\boards\microbuilder\board_rf1ghznode.c
+ board_rf1ghznode.c
+ 0
+ 0
+
+
+ 3
+ 40
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bsp\boards\lpcxpresso\board_lpcxpresso1769.c
+ board_lpcxpresso1769.c
+ 0
+ 0
+
+
+ 3
+ 41
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bsp\boards\lpcxpresso\board_lpcxpresso1347.c
+ board_lpcxpresso1347.c
+ 0
+ 0
+
+
+ 3
+ 42
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bsp\boards\keil\board_mcb4300.c
+ board_mcb4300.c
+ 0
+ 0
+
+
+
+
+ bsp lpc11uxx
+ 0
+ 0
+ 0
+ 0
+
+ 4
+ 43
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ..\..\bs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/keyboardd_app.c b/demos/device/src/keyboardd_app.c
index b072d7e12..9c00972a4 100644
--- a/demos/device/src/keyboardd_app.c
+++ b/demos/device/src/keyboardd_app.c
@@ -127,29 +127,28 @@ OSAL_TASK_FUNCTION( keyboardd_app_task ) (void* p_task_para)
{
OSAL_TASK_LOOP_BEGIN
- if (tusbd_is_configured(0) && (keyboardd_report_count++ < 5) )
+ osal_task_delay(100);
+
+ if ( tusbd_is_configured(0) )
{
- if (!tusbd_hid_keyboard_is_busy(0))
+ static uint32_t button_mask = 0;
+
+ uint32_t new_button_mask = board_buttons();
+
+ //------------- Key pressed -------------//
+ if ( (button_mask != new_button_mask) && !tusbd_hid_keyboard_is_busy(0) )
{
- //------------- Key pressed -------------//
- keyboard_report.keycode[0] = 0x04;
+ button_mask = new_button_mask;
+
+ for (uint8_t i=0; i<6; i++)
+ { // demo support up to 6 buttons, button0 = 'a', button1 = 'b', etc ...
+ keyboard_report.keycode[i] = BIT_TEST_(button_mask, i) ? (0x04+i) : 0;
+ }
+
tusbd_hid_keyboard_send(0, &keyboard_report );
-
- while( tusbd_hid_keyboard_is_busy(0) )
- { // delay for transfer complete
- osal_task_delay(10);
- }
-
- //------------- Key released -------------//
- if (!tusbd_hid_keyboard_is_busy(0))
- {
- keyboard_report.keycode[0] = 0x00;
- tusbd_hid_keyboard_send(0, &keyboard_report );
- }
}
}
- osal_task_delay(1000);
OSAL_TASK_LOOP_END
}
diff --git a/demos/device/src/tusb_config.h b/demos/device/src/tusb_config.h
index 41aaf468a..bfc225351 100644
--- a/demos/device/src/tusb_config.h
+++ b/demos/device/src/tusb_config.h
@@ -82,11 +82,11 @@
#define TUSB_CFG_DEVICE_FULLSPEED 1 // TODO refractor, remove
//------------- CLASS -------------//
-#define TUSB_CFG_DEVICE_HID_KEYBOARD 0
+#define TUSB_CFG_DEVICE_HID_KEYBOARD 1
#define TUSB_CFG_DEVICE_HID_MOUSE 0
#define TUSB_CFG_DEVICE_HID_GENERIC 0
#define TUSB_CFG_DEVICE_MSC 0
-#define TUSB_CFG_DEVICE_CDC 1
+#define TUSB_CFG_DEVICE_CDC 0
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
@@ -99,12 +99,10 @@
#define TUSB_CFG_OS_TICKS_PER_SECOND 1000
#ifdef __CODE_RED // compiled with lpcxpresso
- #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
+ #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX) || (TUSB_CFG_MCU == MCU_LPC175X_6X)
#define TUSB_RAM_SECTION ".data.$RAM2"
#elif (TUSB_CFG_MCU == MCU_LPC43XX)
#define TUSB_RAM_SECTION ".data.$RAM3"
- #elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
- #define TUSB_RAM_SECTION ".data.$RAM2"
#else
#error Please define USB RAM section
#endif