diff options
author | Amir Hammad <amir.hammad@hotmail.com> | 2015-04-08 08:07:43 +0200 |
---|---|---|
committer | Amir Hammad <amir.hammad@hotmail.com> | 2015-04-08 08:08:55 +0200 |
commit | 187d01e3b299465d94de2ad44437cb8e1b5afcbb (patch) | |
tree | f88d833f3a6268b51d7e274fad0ad4e1ca183632 /src | |
parent | 6625cda9f3eea899c41d1ee5b14913e691075e8a (diff) | |
download | secure-hid-187d01e3b299465d94de2ad44437cb8e1b5afcbb.tar.gz secure-hid-187d01e3b299465d94de2ad44437cb8e1b5afcbb.tar.bz2 secure-hid-187d01e3b299465d94de2ad44437cb8e1b5afcbb.zip |
Device drivers: Refactor: Remove prefixes of static functions and variables
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/usbh_driver_gp_xbox.c | 20 | ||||
-rw-r--r-- | src/usbh_driver_hid_mouse.c | 20 | ||||
-rw-r--r-- | src/usbh_driver_hub.c | 22 |
3 files changed, 31 insertions, 31 deletions
diff --git a/src/usbh_driver_gp_xbox.c b/src/usbh_driver_gp_xbox.c index f742246..a2390bd 100644 --- a/src/usbh_driver_gp_xbox.c +++ b/src/usbh_driver_gp_xbox.c @@ -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) { 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 */ -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; 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) * 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; @@ -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"); @@ -396,7 +396,7 @@ static void gp_xbox_remove(void *drvdata) 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, .deviceSubClass = 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 = { - .init = gp_xbox_init, - .analyze_descriptor = gp_xbox_analyze_descriptor, - .poll = gp_xbox_poll, - .remove = gp_xbox_remove, - .info = &usbh_gp_xbox_driver_info + .init = init, + .analyze_descriptor = analyze_descriptor, + .poll = poll, + .remove = remove, + .info = &driver_info }; diff --git a/src/usbh_driver_hid_mouse.c b/src/usbh_driver_hid_mouse.c index 0435138..2afa084 100644 --- a/src/usbh_driver_hid_mouse.c +++ b/src/usbh_driver_hid_mouse.c @@ -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; 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 */ -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; 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) * 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; @@ -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; mouse->state_next = STATE_INACTIVE; 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, .deviceSubClass = -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 = { - .init = mouse_init, - .analyze_descriptor = mouse_analyze_descriptor, - .poll = mouse_poll, - .remove = mouse_remove, - .info = &usbh_hid_mouse_driver_info + .init = init, + .analyze_descriptor = analyze_descriptor, + .poll = poll, + .remove = remove, + .info = &driver_info }; diff --git a/src/usbh_driver_hub.c b/src/usbh_driver_hub.c index fab946d..9aa55be 100644 --- a/src/usbh_driver_hub.c +++ b/src/usbh_driver_hub.c @@ -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;
hub_device_t *drvdata = 0;
@@ -84,7 +84,7 @@ static void *hub_init(void *usbh_dev) /**
* 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;
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)
* 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;
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;
uint8_t i;
@@ -826,7 +826,7 @@ static void hub_remove(void *drvdata) for (i = 1; i < USBH_HUB_MAX_DEVICES + 1; i++) {
if (hub->device[i]) {
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);
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,
.deviceSubClass = -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 = {
- .init = hub_init,
- .analyze_descriptor = hub_analyze_descriptor,
- .poll = hub_poll,
- .remove = hub_remove,
- .info = &usbh_hub_driver_info
+ .init = init,
+ .analyze_descriptor = analyze_descriptor,
+ .poll = poll,
+ .remove = remove,
+ .info = &driver_info
};
|