Fix build for emulated interface.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
8d86a8c56b
commit
b6b53010cc
3 changed files with 10 additions and 5 deletions
|
|
@ -36,8 +36,6 @@ extern TaskHandle_t hcore0, hcore1;
|
|||
static inline uint32_t board_millis(void) {
|
||||
return ( ( ((uint64_t) xTaskGetTickCount()) * 1000) / configTICK_RATE_HZ );
|
||||
}
|
||||
#define PICO_UNIQUE_BOARD_ID_SIZE_BYTES 8
|
||||
typedef struct { uint8_t id[PICO_UNIQUE_BOARD_ID_SIZE_BYTES]; } pico_unique_board_id_t;
|
||||
typedef SemaphoreHandle_t mutex_t;
|
||||
typedef SemaphoreHandle_t semaphore_t;
|
||||
#define mutex_init(a) do { *(a) = xSemaphoreCreateMutex();} while(0)
|
||||
|
|
|
|||
|
|
@ -358,16 +358,19 @@ void core0_loop() {
|
|||
}
|
||||
}
|
||||
|
||||
char pico_serial_str[2 * PICO_UNIQUE_BOARD_ID_SIZE_BYTES + 1];
|
||||
pico_unique_board_id_t pico_serial;
|
||||
#ifdef ESP_PLATFORM
|
||||
#include "tinyusb.h"
|
||||
#include "esp_efuse.h"
|
||||
#define pico_get_unique_board_id(a) do { uint32_t value; esp_efuse_read_block(EFUSE_BLK1, &value, 0, 32); memcpy((uint8_t *)(a), &value, sizeof(uint32_t)); esp_efuse_read_block(EFUSE_BLK1, &value, 32, 32); memcpy((uint8_t *)(a)+4, &value, sizeof(uint32_t)); } while(0)
|
||||
extern const tinyusb_config_t tusb_cfg;
|
||||
TaskHandle_t hcore0 = NULL, hcore1 = NULL;
|
||||
char pico_serial_str[2 * PICO_UNIQUE_BOARD_ID_SIZE_BYTES + 1];
|
||||
pico_unique_board_id_t pico_serial;
|
||||
int app_main() {
|
||||
#else
|
||||
#ifdef ENABLE_EMULATION
|
||||
#define pico_get_unique_board_id(a) memset(a, 0, sizeof(*(a)))
|
||||
#endif
|
||||
int main(void) {
|
||||
#endif
|
||||
pico_get_unique_board_id(&pico_serial);
|
||||
|
|
|
|||
|
|
@ -166,7 +166,11 @@ extern uint32_t button_timeout;
|
|||
#define CCID_WRONG_PADDING -1011
|
||||
#define CCID_VERIFICATION_FAILED -1012
|
||||
|
||||
#if defined(ENABLE_EMULATION) || defined(ESP_PLATFORM)
|
||||
#define PICO_UNIQUE_BOARD_ID_SIZE_BYTES 8
|
||||
typedef struct { uint8_t id[PICO_UNIQUE_BOARD_ID_SIZE_BYTES]; } pico_unique_board_id_t;
|
||||
#endif
|
||||
extern pico_unique_board_id_t pico_serial;
|
||||
extern char pico_serial_str[];
|
||||
extern char pico_serial_str[2 * PICO_UNIQUE_BOARD_ID_SIZE_BYTES + 1];
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue