embedded.h 950 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef EMBEDDED_H
  2. #define EMBEDDED_H
  3. #include <inttypes.h>
  4. /* must provide
  5. - mutex_create_p
  6. - pthread_create_name
  7. - stack size
  8. - s16_t, s32_t, s64_t and u64_t
  9. can overload
  10. - exit
  11. recommended to add platform specific include(s) here
  12. */
  13. #ifndef PTHREAD_STACK_MIN
  14. #define PTHREAD_STACK_MIN 256
  15. #endif
  16. #define STREAM_THREAD_STACK_SIZE 8 * 1024
  17. #define DECODE_THREAD_STACK_SIZE 20 * 1024
  18. #define OUTPUT_THREAD_STACK_SIZE 8 * 1024
  19. #define IR_THREAD_STACK_SIZE 8 * 1024
  20. typedef int16_t s16_t;
  21. typedef int32_t s32_t;
  22. typedef int64_t s64_t;
  23. typedef unsigned long long u64_t;
  24. // all exit() calls are made from main thread (or a function called in main thread)
  25. #define exit(code) { int ret = code; pthread_exit(&ret); }
  26. #define mutex_create_p(m) mutex_create(m)
  27. int pthread_create_name(pthread_t *thread, _CONST pthread_attr_t *attr,
  28. void *(*start_routine)( void * ), void *arg, char *name);
  29. #endif // EMBEDDED_H