embedded.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef EMBEDDED_H
  2. #define EMBEDDED_H
  3. #include "esp_system.h"
  4. #include <inttypes.h>
  5. /* must provide
  6. - mutex_create_p
  7. - pthread_create_name
  8. - stack size
  9. - s16_t, s32_t, s64_t and u64_t
  10. can overload (use #define)
  11. - exit
  12. - gettime_ms
  13. - BASE_CAP
  14. recommended to add platform specific include(s) here
  15. */
  16. #ifndef PTHREAD_STACK_MIN
  17. #define PTHREAD_STACK_MIN 256
  18. #endif
  19. #define STREAM_THREAD_STACK_SIZE 6 * 1024
  20. #define DECODE_THREAD_STACK_SIZE 16 * 1024
  21. #define OUTPUT_THREAD_STACK_SIZE 6 * 1024
  22. #define IR_THREAD_STACK_SIZE 6 * 1024
  23. //#define BASE_CAP "Model=squeezelite,AccuratePlayPoints=0,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION
  24. typedef int16_t s16_t;
  25. typedef int32_t s32_t;
  26. typedef int64_t s64_t;
  27. typedef unsigned long long u64_t;
  28. // all exit() calls are made from main thread (or a function called in main thread)
  29. #define exit(code) { int ret = code; pthread_exit(&ret); }
  30. #define gettime_ms _gettime_ms_
  31. #define mutex_create_p(m) mutex_create(m)
  32. uint32_t _gettime_ms_(void);
  33. int pthread_create_name(pthread_t *thread, _CONST pthread_attr_t *attr,
  34. void *(*start_routine)( void * ), void *arg, char *name);
  35. // these are here as they can be #define to nothing
  36. extern bool enable_bt_sink;
  37. extern bool enable_airplay;
  38. void register_external(void);
  39. void deregister_external(void);
  40. #endif // EMBEDDED_H