Device drivers: Refactor: Remove prefixes of static functions and variables
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
This commit is contained in:
parent
6625cda9f3
commit
187d01e3b2
3 changed files with 31 additions and 31 deletions
|
|
@ -74,7 +74,7 @@ void gp_xbox_driver_init(const gp_xbox_config_t *config)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void *gp_xbox_init(void *usbh_dev)
|
static void *init(void *usbh_dev)
|
||||||
{
|
{
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
LOG_PRINTF("driver not initialized");
|
LOG_PRINTF("driver not initialized");
|
||||||
|
|
@ -102,7 +102,7 @@ static void *gp_xbox_init(void *usbh_dev)
|
||||||
/**
|
/**
|
||||||
* Returns true if all needed data are parsed
|
* Returns true if all needed data are parsed
|
||||||
*/
|
*/
|
||||||
static bool gp_xbox_analyze_descriptor(void *drvdata, void *descriptor)
|
static bool analyze_descriptor(void *drvdata, void *descriptor)
|
||||||
{
|
{
|
||||||
gp_xbox_device_t *gp_xbox = (gp_xbox_device_t *)drvdata;
|
gp_xbox_device_t *gp_xbox = (gp_xbox_device_t *)drvdata;
|
||||||
uint8_t desc_type = ((uint8_t *)descriptor)[1];
|
uint8_t desc_type = ((uint8_t *)descriptor)[1];
|
||||||
|
|
@ -346,7 +346,7 @@ static void read_gp_xbox_in(gp_xbox_device_t *gp_xbox)
|
||||||
* \param time_curr_us - monotically rising time (see usbh_hubbed.h)
|
* \param time_curr_us - monotically rising time (see usbh_hubbed.h)
|
||||||
* unit is microseconds
|
* unit is microseconds
|
||||||
*/
|
*/
|
||||||
static void gp_xbox_poll(void *drvdata, uint32_t time_curr_us)
|
static void poll(void *drvdata, uint32_t time_curr_us)
|
||||||
{
|
{
|
||||||
(void)time_curr_us;
|
(void)time_curr_us;
|
||||||
|
|
||||||
|
|
@ -384,7 +384,7 @@ static void gp_xbox_poll(void *drvdata, uint32_t time_curr_us)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gp_xbox_remove(void *drvdata)
|
static void remove(void *drvdata)
|
||||||
{
|
{
|
||||||
LOG_PRINTF("Removing xbox\r\n");
|
LOG_PRINTF("Removing xbox\r\n");
|
||||||
|
|
||||||
|
|
@ -396,7 +396,7 @@ static void gp_xbox_remove(void *drvdata)
|
||||||
gp_xbox->endpoint_in_address = 0;
|
gp_xbox->endpoint_in_address = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const usbh_dev_driver_info_t usbh_gp_xbox_driver_info = {
|
static const usbh_dev_driver_info_t driver_info = {
|
||||||
.deviceClass = 0xff,
|
.deviceClass = 0xff,
|
||||||
.deviceSubClass = 0xff,
|
.deviceSubClass = 0xff,
|
||||||
.deviceProtocol = 0xff,
|
.deviceProtocol = 0xff,
|
||||||
|
|
@ -408,9 +408,9 @@ static const usbh_dev_driver_info_t usbh_gp_xbox_driver_info = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const usbh_dev_driver_t usbh_gp_xbox_driver = {
|
const usbh_dev_driver_t usbh_gp_xbox_driver = {
|
||||||
.init = gp_xbox_init,
|
.init = init,
|
||||||
.analyze_descriptor = gp_xbox_analyze_descriptor,
|
.analyze_descriptor = analyze_descriptor,
|
||||||
.poll = gp_xbox_poll,
|
.poll = poll,
|
||||||
.remove = gp_xbox_remove,
|
.remove = remove,
|
||||||
.info = &usbh_gp_xbox_driver_info
|
.info = &driver_info
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ void hid_mouse_driver_init(const hid_mouse_config_t *config)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void *mouse_init(void *usbh_dev)
|
static void *init(void *usbh_dev)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
hid_mouse_device_t *drvdata = 0;
|
hid_mouse_device_t *drvdata = 0;
|
||||||
|
|
@ -94,7 +94,7 @@ static void *mouse_init(void *usbh_dev)
|
||||||
/**
|
/**
|
||||||
* Returns true if all needed data are parsed
|
* Returns true if all needed data are parsed
|
||||||
*/
|
*/
|
||||||
static bool mouse_analyze_descriptor(void *drvdata, void *descriptor)
|
static bool analyze_descriptor(void *drvdata, void *descriptor)
|
||||||
{
|
{
|
||||||
hid_mouse_device_t *mouse = (hid_mouse_device_t *)drvdata;
|
hid_mouse_device_t *mouse = (hid_mouse_device_t *)drvdata;
|
||||||
uint8_t desc_type = ((uint8_t *)descriptor)[1];
|
uint8_t desc_type = ((uint8_t *)descriptor)[1];
|
||||||
|
|
@ -227,7 +227,7 @@ static void read_mouse_in(void *drvdata)
|
||||||
* \param time_curr_us - monotically rising time (see usbh_hubbed.h)
|
* \param time_curr_us - monotically rising time (see usbh_hubbed.h)
|
||||||
* unit is microseconds
|
* unit is microseconds
|
||||||
*/
|
*/
|
||||||
static void mouse_poll(void *drvdata, uint32_t time_curr_us)
|
static void poll(void *drvdata, uint32_t time_curr_us)
|
||||||
{
|
{
|
||||||
(void)time_curr_us;
|
(void)time_curr_us;
|
||||||
|
|
||||||
|
|
@ -262,14 +262,14 @@ static void mouse_poll(void *drvdata, uint32_t time_curr_us)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_remove(void *drvdata)
|
static void remove(void *drvdata)
|
||||||
{
|
{
|
||||||
hid_mouse_device_t *mouse = (hid_mouse_device_t *)drvdata;
|
hid_mouse_device_t *mouse = (hid_mouse_device_t *)drvdata;
|
||||||
mouse->state_next = STATE_INACTIVE;
|
mouse->state_next = STATE_INACTIVE;
|
||||||
mouse->endpoint_in_address = 0;
|
mouse->endpoint_in_address = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const usbh_dev_driver_info_t usbh_hid_mouse_driver_info = {
|
static const usbh_dev_driver_info_t driver_info = {
|
||||||
.deviceClass = -1,
|
.deviceClass = -1,
|
||||||
.deviceSubClass = -1,
|
.deviceSubClass = -1,
|
||||||
.deviceProtocol = -1,
|
.deviceProtocol = -1,
|
||||||
|
|
@ -281,9 +281,9 @@ static const usbh_dev_driver_info_t usbh_hid_mouse_driver_info = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const usbh_dev_driver_t usbh_hid_mouse_driver = {
|
const usbh_dev_driver_t usbh_hid_mouse_driver = {
|
||||||
.init = mouse_init,
|
.init = init,
|
||||||
.analyze_descriptor = mouse_analyze_descriptor,
|
.analyze_descriptor = analyze_descriptor,
|
||||||
.poll = mouse_poll,
|
.poll = poll,
|
||||||
.remove = mouse_remove,
|
.remove = remove,
|
||||||
.info = &usbh_hid_mouse_driver_info
|
.info = &driver_info
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ void hub_driver_init(void)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void *hub_init(void *usbh_dev)
|
static void *init(void *usbh_dev)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
hub_device_t *drvdata = 0;
|
hub_device_t *drvdata = 0;
|
||||||
|
|
@ -84,7 +84,7 @@ static void *hub_init(void *usbh_dev)
|
||||||
/**
|
/**
|
||||||
* Returns true if all needed data are parsed
|
* Returns true if all needed data are parsed
|
||||||
*/
|
*/
|
||||||
static bool hub_analyze_descriptor(void *drvdata, void *descriptor)
|
static bool analyze_descriptor(void *drvdata, void *descriptor)
|
||||||
{
|
{
|
||||||
hub_device_t *hub = (hub_device_t *)drvdata;
|
hub_device_t *hub = (hub_device_t *)drvdata;
|
||||||
uint8_t desc_type = ((uint8_t *)descriptor)[1];
|
uint8_t desc_type = ((uint8_t *)descriptor)[1];
|
||||||
|
|
@ -744,7 +744,7 @@ static void read_ep1(void *drvdata)
|
||||||
* \param time_curr_us - monotically rising time (see usbh_hubbed.h)
|
* \param time_curr_us - monotically rising time (see usbh_hubbed.h)
|
||||||
* unit is microseconds
|
* unit is microseconds
|
||||||
*/
|
*/
|
||||||
static void hub_poll(void *drvdata, uint32_t time_curr_us)
|
static void poll(void *drvdata, uint32_t time_curr_us)
|
||||||
{
|
{
|
||||||
hub_device_t *hub = (hub_device_t *)drvdata;
|
hub_device_t *hub = (hub_device_t *)drvdata;
|
||||||
usbh_device_t *dev = hub->device[0];
|
usbh_device_t *dev = hub->device[0];
|
||||||
|
|
@ -814,7 +814,7 @@ static void hub_poll(void *drvdata, uint32_t time_curr_us)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void hub_remove(void *drvdata)
|
static void remove(void *drvdata)
|
||||||
{
|
{
|
||||||
hub_device_t *hub = (hub_device_t *)drvdata;
|
hub_device_t *hub = (hub_device_t *)drvdata;
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
@ -826,7 +826,7 @@ static void hub_remove(void *drvdata)
|
||||||
for (i = 1; i < USBH_HUB_MAX_DEVICES + 1; i++) {
|
for (i = 1; i < USBH_HUB_MAX_DEVICES + 1; i++) {
|
||||||
if (hub->device[i]) {
|
if (hub->device[i]) {
|
||||||
if (hub->device[i]->drv && hub->device[i]->drvdata) {
|
if (hub->device[i]->drv && hub->device[i]->drvdata) {
|
||||||
if (hub->device[i]->drv->remove != hub_remove) {
|
if (hub->device[i]->drv->remove != remove) {
|
||||||
LOG_PRINTF("\t\t\t\tHUB REMOVE %d\r\n",hub->device[i]->address);
|
LOG_PRINTF("\t\t\t\tHUB REMOVE %d\r\n",hub->device[i]->address);
|
||||||
hub->device[i]->drv->remove(hub->device[i]->drvdata);
|
hub->device[i]->drv->remove(hub->device[i]->drvdata);
|
||||||
}
|
}
|
||||||
|
|
@ -840,7 +840,7 @@ static void hub_remove(void *drvdata)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const usbh_dev_driver_info_t usbh_hub_driver_info = {
|
static const usbh_dev_driver_info_t driver_info = {
|
||||||
.deviceClass = 0x09,
|
.deviceClass = 0x09,
|
||||||
.deviceSubClass = -1,
|
.deviceSubClass = -1,
|
||||||
.deviceProtocol = -1,
|
.deviceProtocol = -1,
|
||||||
|
|
@ -852,9 +852,9 @@ static const usbh_dev_driver_info_t usbh_hub_driver_info = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const usbh_dev_driver_t usbh_hub_driver = {
|
const usbh_dev_driver_t usbh_hub_driver = {
|
||||||
.init = hub_init,
|
.init = init,
|
||||||
.analyze_descriptor = hub_analyze_descriptor,
|
.analyze_descriptor = analyze_descriptor,
|
||||||
.poll = hub_poll,
|
.poll = poll,
|
||||||
.remove = hub_remove,
|
.remove = remove,
|
||||||
.info = &usbh_hub_driver_info
|
.info = &driver_info
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue