mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
able to build test hidh
hack include in hid_host_keyboard.h
This commit is contained in:
parent
ddeec330fa
commit
45db7b4a53
@ -35,17 +35,34 @@
|
||||
* This file is part of the tiny usb stack.
|
||||
*/
|
||||
|
||||
#include "stdlib.h"
|
||||
#include "unity.h"
|
||||
#include "errors.h"
|
||||
|
||||
#include "mock_osal.h"
|
||||
#include "mock_hcd.h"
|
||||
#include "mock_usbh.h"
|
||||
#include "mock_hid_host_keyboard.h"
|
||||
|
||||
#include "hid_host.h"
|
||||
|
||||
uint8_t dev_addr;
|
||||
uint8_t instance_num;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
instance_num = 0;
|
||||
dev_addr = RANDOM(TUSB_CFG_HOST_DEVICE_MAX)+1;
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
}
|
||||
|
||||
void test_hidh()
|
||||
void test_hidh_init()
|
||||
{
|
||||
TEST_IGNORE();
|
||||
// hidh_keyboard_init_Expect();
|
||||
// //------------- Code Under TEST -------------//
|
||||
// hidh_init();
|
||||
TEST_FAIL();
|
||||
}
|
||||
|
@ -60,7 +60,9 @@ STATIC_ hidh_keyboard_info_t keyboard_data[TUSB_CFG_HOST_DEVICE_MAX]; // does no
|
||||
// IMPLEMENTATION
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
//------------- PUBLIC API (Parameter Verification is required) -------------//
|
||||
//--------------------------------------------------------------------+
|
||||
// PUBLIC API (parameter validation required)
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_error_t tusbh_hid_keyboard_get(uint8_t const dev_addr, uint8_t instance_num, tusb_keyboard_report_t * const report)
|
||||
{
|
||||
//------------- parameters validation -------------//
|
||||
@ -87,6 +89,9 @@ uint8_t tusbh_hid_keyboard_no_instances(uint8_t const dev_addr)
|
||||
return keyboard_data[dev_addr-1].instance_count;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INTERNAL API (no need for parameter validation)
|
||||
//--------------------------------------------------------------------+
|
||||
void hidh_keyboard_init(void)
|
||||
{
|
||||
memclr_(&keyboard_data, sizeof(hidh_keyboard_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
|
||||
|
@ -52,6 +52,8 @@
|
||||
#define _TUSB_HID_HOST_KEYBOARD_H_
|
||||
|
||||
#include "common/common.h"
|
||||
#include "usbh.h" // TODO refractor
|
||||
#include "hid.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user