| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 | #pragma once#define _GNU_SOURCE 1#include "compiler.h"/* Standard C headers */#include <inttypes.h>#include <stdarg.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>/* Arduino headers */#include <Arduino.h>#include <FreeRTOS.h>/* ESP-IDF headers */#include <sdkconfig.h>#include <esp_err.h>#include <esp_event.h>#include <esp_log.h>#include "xmalloc.h"#ifndef MODULE# define MODULE ""#endif#if DEBUG# define CMSG(...) printf(__VA_ARGS__)#else# define CMSG(...) ((void)0)#endif#define MSG(...)  CMSG(MODULE ": " __VA_ARGS__)/* * Hack to deal with the lack of this information in FreeRTOS proper */#define EVENT_BITS	(configUSE_16_BIT_TICKS ? 8 : 24)#define EVENT_ALL_BITS	((1U << EVENT_BITS)-1)/* * Common types for callbacks */typedef void *token_t;typedef int (*read_func_t)(token_t token, void *buf, size_t len);typedef int (*write_func_t)(token_t token, const void *buf, size_t len);/* * Sleep thread... */static inline void suspend(void){    vTaskSuspend(NULL);}/* * Reboot system */extern_c void reboot_now(void);extern_c int reboot_delayed(void);/* * Board version */extern_c uint8_t max80_board_version;/* * Time sync status */extern_c volatile bool time_net_sync_status;struct timeval;extern_c void time_net_sync(const struct timeval *tv);extern_c void print_time(const char *msg, const struct timeval *tv);
 |