The official µGFX library repository.

gos_nios.c 916B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_NIOS
  9. void _gosHeapInit(void);
  10. void _gosThreadsInit(void);
  11. /*********************************************************
  12. * Initialise
  13. *********************************************************/
  14. void _gosInit(void)
  15. {
  16. // Set up the heap allocator
  17. _gosHeapInit();
  18. // Start the scheduler
  19. _gosThreadsInit();
  20. }
  21. void _gosDeinit(void)
  22. {
  23. }
  24. void gfxHalt(const char *msg)
  25. {
  26. volatile uint32_t dummy;
  27. (void)msg;
  28. while(1) {
  29. dummy++;
  30. }
  31. }
  32. void gfxExit(void) {
  33. volatile uint32_t dummy;
  34. while(1) {
  35. dummy++;
  36. }
  37. }
  38. systemticks_t gfxSystemTicks(void)
  39. {
  40. return alt_nticks();
  41. }
  42. systemticks_t gfxMillisecondsToTicks(delaytime_t ms)
  43. {
  44. return ms;
  45. }
  46. #endif /* GFX_USE_OS_NIOS */