usbbus: make usb_initialized static

This commit is contained in:
Philippe Teuwen 2013-03-02 12:43:15 +01:00
parent 1f0b0e5b81
commit ae571941c5
3 changed files with 3 additions and 8 deletions

View file

@ -54,5 +54,4 @@ libnfc.so.4 libnfc4 #MINVER#
str_nfc_baud_rate@Base 1.7.0~rc2
str_nfc_modulation_type@Base 1.7.0~rc2
str_nfc_target@Base 1.7.0~rc2
usb_initialized@Base 1.7.0~rc6-0
usb_prepare@Base 1.7.0~rc6-0

View file

@ -32,13 +32,12 @@
#define LOG_CATEGORY "libnfc.buses.usbbus"
#define LOG_GROUP NFC_LOG_GROUP_DRIVER
// Global flag to know if usb_init() has already been called or not
bool usb_initialized = false;
int usb_prepare(void)
{
if (usb_initialized)
static bool usb_initialized = false;
if (usb_initialized) {
return 0;
}
usb_init();
usb_initialized = true;

View file

@ -41,9 +41,6 @@
#include <stdbool.h>
#include <string.h>
// Global flag to know if usb_init() has already been called or not
extern bool usb_initialized;
int usb_prepare(void);
#endif // __NFC_BUS_USB_H__