µGFX library fork

gos_arduino.c 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * This file is subject to the terms of the GFX License. If a copy of
  3. * the license was not distributed with this file, you can obtain one at:
  4. *
  5. * http://ugfx.org/license.html
  6. */
  7. #include "../../gfx.h"
  8. #if GFX_USE_OS_ARDUINO
  9. #include <string.h> // Prototype for memcpy()
  10. void _gosHeapInit(void);
  11. void _gosThreadsInit(void);
  12. /*********************************************************
  13. * Initialise
  14. *********************************************************/
  15. void _gosInit(void)
  16. {
  17. /* No initialization of the operating system itself is needed as there isn't one.
  18. * On the other hand the C runtime should still already be initialized before
  19. * getting here!
  20. */
  21. #if !GFX_OS_INIT_NO_WARNING
  22. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  23. #warning "GOS: Arduino - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
  24. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  25. COMPILER_WARNING("GOS: Arduino - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!")
  26. #endif
  27. #endif
  28. // Start the heap allocator
  29. _gosHeapInit();
  30. // Start the scheduler
  31. _gosThreadsInit();
  32. }
  33. void _gosPostInit(void)
  34. {
  35. }
  36. void _gosDeinit(void)
  37. {
  38. /* ToDo */
  39. }
  40. /*********************************************************
  41. * Exit everything functions
  42. *********************************************************/
  43. void gfxHalt(const char *msg) {
  44. volatile uint32_t dummy;
  45. (void) msg;
  46. while(1)
  47. dummy++;
  48. }
  49. void gfxExit(void) {
  50. volatile uint32_t dummy;
  51. while(1)
  52. dummy++;
  53. }
  54. /*********************************************************
  55. * Sleep functions
  56. *********************************************************/
  57. systemticks_t gfxSystemTicks(void) {
  58. return millis();
  59. }
  60. systemticks_t gfxMillisecondsToTicks(delaytime_t ms) {
  61. return ms;
  62. }
  63. #endif /* GFX_USE_OS_ARDUINO */