12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #pragma once
- #define _GNU_SOURCE 1
- #include "compiler.h"
- #include <inttypes.h>
- #include <stdarg.h>
- #include <stdbool.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <Arduino.h>
- #include <FreeRTOS.h>
- #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__)
- #define EVENT_BITS (configUSE_16_BIT_TICKS ? 8 : 24)
- #define EVENT_ALL_BITS ((1U << EVENT_BITS)-1)
- 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);
- static inline void suspend(void)
- {
- vTaskSuspend(NULL);
- }
- static inline no_return exit_task(void)
- {
- vTaskDelete(NULL);
- while (1) {
-
- vTaskSuspend(NULL);
- }
- }
- extern_c void reboot_now(void);
- extern_c int reboot_delayed(void);
- extern_c uint8_t efuse_default_mac[6];
- 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);
|