USB comms: part 3 towards @micolous PR#463

* change variable 'sp' from global to static
* move code to open and close USB port to comms.c (OpenProxmark() and CloseProxmark())
* change scope of USBCommandReceived() to static
* (flasher still unchanged)
This commit is contained in:
pwpiwi 2018-04-28 10:09:16 +02:00 committed by GitHub
parent 61aaee35cc
commit 818efbebb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 42 deletions

View file

@ -31,19 +31,18 @@ typedef struct {
} receiver_arg;
// Wrappers required as static variables can only be used in one file.
void SetOffline(bool new_offline);
bool IsOffline();
bool OpenProxmark(char *portname, bool waitCOMPort, int timeout);
void CloseProxmark(void);
void SendCommand(UsbCommand *c);
void *uart_receiver(void *targ);
void UsbCommandReceived(UsbCommand *UC);
void clearCommandBuffer();
bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeout, bool show_warning);
bool WaitForResponseTimeout(uint32_t cmd, UsbCommand* response, size_t ms_timeout);
bool WaitForResponse(uint32_t cmd, UsbCommand* response);
extern serial_port sp;
#endif // COMMS_H_