USB comms: part 4 towards @micolous PR #463

* make uart_communication(), storeCommand() and getCommand() static in comms.c
* move receiver thread creation and respective mutexes to comms.c
* add mutex and signal for tx buffer
* use comms.c for flasher as well
* remove comm functions from client/proxmark3.h
* this completes isolating all USB communication related functions in comms.c
* don't assume a port to be defined by a name. Change parameter in OpenProxmark() to void*
* comms.c: set sp and serial_port_name to NULL when offline
This commit is contained in:
pwpiwi 2018-06-03 14:25:20 +02:00 committed by GitHub
commit ad939de501
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 274 additions and 248 deletions

View file

@ -10,8 +10,7 @@
#define __FLASH_H__
#include <stdint.h>
#include "elf.h"
#include "uart.h"
#include <stdbool.h>
typedef struct {
void *data;
@ -26,14 +25,10 @@ typedef struct {
flash_seg_t *segments;
} flash_file_t;
int flash_load(flash_file_t *ctx, const char *name, int can_write_bl);
int flash_load(flash_file_t *ctx, const char *name, bool can_write_bl);
int flash_start_flashing(int enable_bl_writes, char *serial_port_name);
int flash_write(flash_file_t *ctx);
void flash_free(flash_file_t *ctx);
int flash_stop_flashing(void);
void CloseProxmark(const char *serial_port_name);
bool OpenProxmark(size_t i, const char *serial_port_name);
extern serial_port sp;
#endif