esp_system_linux.c 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /*
  7. * All functions presented here are stubs for the POSIX/Linux implementation of FReeRTOS.
  8. * They are meant to allow to compile, but they DO NOT return any meaningful value.
  9. */
  10. #include <stdlib.h>
  11. #include <stdint.h>
  12. #include "esp_private/system_internal.h"
  13. #include "esp_heap_caps.h"
  14. // dummy, we should never get here on Linux
  15. void esp_restart_noos_dig(void)
  16. {
  17. abort();
  18. }
  19. uint32_t esp_get_free_heap_size( void )
  20. {
  21. return heap_caps_get_free_size( MALLOC_CAP_DEFAULT );
  22. }
  23. uint32_t esp_get_free_internal_heap_size( void )
  24. {
  25. return heap_caps_get_free_size( MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL );
  26. }
  27. uint32_t esp_get_minimum_free_heap_size( void )
  28. {
  29. return heap_caps_get_minimum_free_size( MALLOC_CAP_DEFAULT );
  30. }
  31. const char *esp_get_idf_version(void)
  32. {
  33. return IDF_VER;
  34. }
  35. void __attribute__((noreturn)) esp_system_abort(const char *details)
  36. {
  37. exit(1);
  38. }