summaryrefslogtreecommitdiff
path: root/demos/host/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-14 11:59:39 +0700
committerhathach <[email protected]>2014-03-14 11:59:39 +0700
commit5e2ed2534ebc7576f028e09023bae923965c645e (patch)
tree1f613ccf069bcdb02d65ec91f3d1bb428a205e70 /demos/host/src
parent214af7e9885f100d4f4d1882e9305899b6afc2b7 (diff)
clean up warning in lpcxpresso
remove -Wpacked -Wpadded in gcc
Diffstat (limited to 'demos/host/src')
-rw-r--r--demos/host/src/cdc_serial_app.c8
-rw-r--r--demos/host/src/cli.c14
-rw-r--r--demos/host/src/keyboard_app.c7
-rw-r--r--demos/host/src/mouse_app.c7
-rw-r--r--demos/host/src/msc_app.c6
5 files changed, 28 insertions, 14 deletions
diff --git a/demos/host/src/cdc_serial_app.c b/demos/host/src/cdc_serial_app.c
index 6c9e2359e..6226d44b9 100644
--- a/demos/host/src/cdc_serial_app.c
+++ b/demos/host/src/cdc_serial_app.c
@@ -61,7 +61,7 @@ static uint8_t received_bytes; // set by transfer complete callback
//--------------------------------------------------------------------+
void tusbh_cdc_mounted_cb(uint8_t dev_addr)
{ // application set-up
- printf("\na CDC device is mounted\n");
+ printf("\na CDC device (address %d) is mounted\n", dev_addr);
memclr_(serial_in_buffer, sizeof(serial_in_buffer));
memclr_(serial_out_buffer, sizeof(serial_out_buffer));
@@ -73,11 +73,13 @@ void tusbh_cdc_mounted_cb(uint8_t dev_addr)
void tusbh_cdc_unmounted_cb(uint8_t dev_addr)
{ // application tear-down
- printf("\na CDC device is unmounted\n");
+ printf("\na CDC device (address %d) is unmounted \n", dev_addr);
}
void tusbh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
{
+ (void) dev_addr; // compiler warnings
+
switch ( pipe_id )
{
case CDC_PIPE_DATA_IN:
@@ -119,6 +121,8 @@ void cdc_serial_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( cdc_serial_app_task ) (void* p_task_para)
{
+ (void) p_task_para;
+
OSAL_TASK_LOOP_BEGIN
//------------- send characters got from uart terminal to the first CDC device -------------//
diff --git a/demos/host/src/cli.c b/demos/host/src/cli.c
index 1dd2aadd9..da3f2efb8 100644
--- a/demos/host/src/cli.c
+++ b/demos/host/src/cli.c
@@ -206,11 +206,11 @@ void cli_poll(char ch)
//------------- Separate Command & Parameter -------------//
putchar('\n');
char* p_space = strchr(cli_buffer, ' ');
- uint32_t command_len = (p_space == NULL) ? strlen(cli_buffer) : (p_space - cli_buffer);
+ uint32_t command_len = (p_space == NULL) ? strlen(cli_buffer) : (uint32_t) (p_space - cli_buffer);
char* p_para = (p_space == NULL) ? (cli_buffer+command_len) : (p_space+1); // point to NULL-character or after space
//------------- Find entered command in lookup table & execute it -------------//
- uint32_t cmd_id;
+ uint8_t cmd_id;
for(cmd_id = CLI_CMDTYPE_COUNT - 1; cmd_id > CLI_CMDTYPE_unknown; cmd_id--)
{
if( 0 == strncmp(cli_buffer, cli_string_tbl[cmd_id], command_len) ) break;
@@ -230,8 +230,9 @@ void cli_poll(char ch)
//--------------------------------------------------------------------+
// UNKNOWN Command
//--------------------------------------------------------------------+
-cli_error_t cli_cmd_unknown(char * para)
+cli_error_t cli_cmd_unknown(char * p_para)
{
+ (void) p_para;
puts("unknown command, please type \"help\" for list of supported commands");
return CLI_ERROR_NONE;
}
@@ -239,10 +240,12 @@ cli_error_t cli_cmd_unknown(char * para)
//--------------------------------------------------------------------+
// HELP command
//--------------------------------------------------------------------+
-cli_error_t cli_cmd_help(char * para)
+cli_error_t cli_cmd_help(char * p_para)
{
+ (void) p_para;
+
puts("current supported commands are:");
- for(uint32_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
+ for(uint8_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
{
printf("%s\t%s\n", cli_string_tbl[cmd_id], cli_description_tbl[cmd_id]);
}
@@ -255,6 +258,7 @@ cli_error_t cli_cmd_help(char * para)
//--------------------------------------------------------------------+
cli_error_t cli_cmd_clear(char* p_para)
{
+ (void) p_para;
printf(ANSI_ERASE_SCREEN(2) ANSI_CURSOR_POSITION(1,1) );
return CLI_ERROR_NONE;
}
diff --git a/demos/host/src/keyboard_app.c b/demos/host/src/keyboard_app.c
index a6631a760..6a770a06d 100644
--- a/demos/host/src/keyboard_app.c
+++ b/demos/host/src/keyboard_app.c
@@ -67,8 +67,7 @@ static inline void process_kbd_report(hid_keyboard_report_t const * report);
void tusbh_hid_keyboard_mounted_cb(uint8_t dev_addr)
{
// application set-up
-
- puts("\na Keyboard device is mounted");
+ printf("\na Keyboard device (address %d) is mounted\n", dev_addr);
osal_queue_flush(queue_kbd_hdl);
tusbh_hid_keyboard_get_report(dev_addr, (uint8_t*) &usb_keyboard_report); // first report
@@ -77,7 +76,7 @@ void tusbh_hid_keyboard_mounted_cb(uint8_t dev_addr)
void tusbh_hid_keyboard_unmounted_cb(uint8_t dev_addr)
{
// application tear-down
- puts("\na Keyboard device is unmounted");
+ printf("\na Keyboard device (address %d) is unmounted\n", dev_addr);
}
void tusbh_hid_keyboard_isr(uint8_t dev_addr, tusb_event_t event)
@@ -115,6 +114,8 @@ void keyboard_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( keyboard_app_task ) (void* p_task_para)
{
+ (void) p_task_para;
+
hid_keyboard_report_t kbd_report;
tusb_error_t error;
diff --git a/demos/host/src/mouse_app.c b/demos/host/src/mouse_app.c
index 6fdba4591..0f1323a2e 100644
--- a/demos/host/src/mouse_app.c
+++ b/demos/host/src/mouse_app.c
@@ -66,8 +66,7 @@ static inline void process_mouse_report(hid_mouse_report_t const * p_report);
void tusbh_hid_mouse_mounted_cb(uint8_t dev_addr)
{
// application set-up
-
- puts("\na Mouse device is mounted");
+ printf("\na Mouse device (address %d) is mounted\n", dev_addr);
osal_queue_flush(queue_mouse_hdl);
(void) tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // first report
@@ -76,7 +75,7 @@ void tusbh_hid_mouse_mounted_cb(uint8_t dev_addr)
void tusbh_hid_mouse_unmounted_cb(uint8_t dev_addr)
{
// application tear-down
- puts("\na Mouse device is unmounted\n");
+ printf("\na Mouse device (address %d) is unmounted\n", dev_addr);
}
void tusbh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event)
@@ -116,6 +115,8 @@ void mouse_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( mouse_app_task ) (void* p_task_para)
{
+ (void) p_task_para;
+
tusb_error_t error;
hid_mouse_report_t mouse_report;
diff --git a/demos/host/src/msc_app.c b/demos/host/src/msc_app.c
index ddda6d3ab..fa1f0696d 100644
--- a/demos/host/src/msc_app.c
+++ b/demos/host/src/msc_app.c
@@ -132,7 +132,9 @@ void tusbh_msc_unmounted_cb(uint8_t dev_addr)
void tusbh_msc_isr(uint8_t dev_addr, tusb_event_t event, uint32_t xferred_bytes)
{
-
+ (void) dev_addr;
+ (void) event;
+ (void) xferred_bytes;
}
//--------------------------------------------------------------------+
@@ -147,6 +149,8 @@ void msc_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( msc_app_task ) (void* p_task_para)
{
+ (void) p_task_para;
+
OSAL_TASK_LOOP_BEGIN
bool is_any_disk_mounted;