Commit ae571941 authored by Philippe Teuwen's avatar Philippe Teuwen

usbbus: make usb_initialized static

parent 1f0b0e5b
......@@ -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
......@@ -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;
......
......@@ -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__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment