Просмотр исходного кода

use unsigned char instead of char for error string
use #if 0 instead of // for remove code

hathach 13 лет назад
Родитель
Сommit
b5207ff146
4 измененных файлов с 12 добавлено и 8 удалено
  1. 6 4
      tinyusb/class/cdc.c
  2. 4 2
      tinyusb/class/hid_host.c
  3. 1 1
      tinyusb/common/errors.c
  4. 1 1
      tinyusb/common/errors.h

+ 6 - 4
tinyusb/class/cdc.c

@@ -188,12 +188,14 @@ uint16_t tusb_cdc_recv(uint8_t* buffer, uint16_t max)
   return fifo_read_n(&ffRX, buffer, max);
 }
 
+#if 0
 // ROM driver bug: cannot hook this to CIC_GetRequest
 // Need this to implement GetLineCode & detect
-//ErrorCode_t CDC_Control_GetRequest(USBD_HANDLE_T hUsb, USB_SETUP_PACKET *pSetup, uint8_t **pBuffer, uint16_t *length)
-//{
-//  return LPC_OK;
-//}
+ErrorCode_t CDC_Control_GetRequest(USBD_HANDLE_T hUsb, USB_SETUP_PACKET *pSetup, uint8_t **pBuffer, uint16_t *length)
+{
+  return LPC_OK;
+}
+#endif
 
 /**************************************************************************/
 /*!

+ 4 - 2
tinyusb/class/hid_host.c

@@ -35,9 +35,11 @@
  * This file is part of the tiny usb stack.
  */
 
-#include "hid_host.h"
+#include "common/common.h"
+
+#if defined TUSB_CFG_HOST && defined DEVICE_CLASS_HID
 
-#if defined DEVICE_CLASS_HID && defined TUSB_CFG_HOST
+#include "hid_host.h"
 
 tusb_error_t tusbh_keyboard_get(tusb_handle_configure_t const config_hdl, tusb_keyboard_report_t * const report)
 {

+ 1 - 1
tinyusb/common/errors.c

@@ -39,7 +39,7 @@
 
 #if TUSB_CFG_DEBUG == 3
 
-char const* const TUSB_ErrorStr[] =
+unsigned char const* const TUSB_ErrorStr[] =
 {
  ERROR_TABLE(ERROR_STRING)
  0

+ 1 - 1
tinyusb/common/errors.h

@@ -76,7 +76,7 @@ typedef enum {
 
 #if TUSB_CFG_DEBUG == 3
 /// Enum to String for debugging purposes. Only available if \ref TUSB_CFG_DEBUG > 0
-extern char const* const TUSB_ErrorStr[];
+extern unsigned char const* const TUSB_ErrorStr[];
 #endif
 
 #ifdef __cplusplus