esp_newlib.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <sys/reent.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /*
  12. * Initialize newlib time functions
  13. */
  14. void esp_newlib_time_init(void);
  15. /**
  16. * Replacement for newlib's _REENT_INIT_PTR and __sinit.
  17. *
  18. * Called from startup code and FreeRTOS, not intended to be called from
  19. * application code.
  20. */
  21. void esp_reent_init(struct _reent* r);
  22. /**
  23. * Clean up some of lazily allocated buffers in REENT structures.
  24. */
  25. void esp_reent_cleanup(void);
  26. /**
  27. * Function which sets up newlib in ROM for use with ESP-IDF
  28. *
  29. * Includes defining the syscall table, setting up any common locks, etc.
  30. *
  31. * Called from the startup code, not intended to be called from application
  32. * code.
  33. */
  34. void esp_newlib_init(void);
  35. void esp_setup_syscall_table(void) __attribute__((deprecated("Please call esp_newlib_init() in newer code")));
  36. /**
  37. * Update current microsecond time from RTC
  38. */
  39. void esp_set_time_from_rtc(void);
  40. /*
  41. * Sync timekeeping timers, RTC and high-resolution timer. Update boot_time.
  42. */
  43. void esp_sync_timekeeping_timers(void);
  44. /* Kept for backward compatibility */
  45. #define esp_sync_counters_rtc_and_frc esp_sync_timekeeping_timers
  46. /**
  47. * Initialize newlib static locks
  48. */
  49. void esp_newlib_locks_init(void);
  50. #ifdef __cplusplus
  51. }
  52. #endif