application.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009 - 2011, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2011-05-23 aozima first implementation for PIC32.
  13. */
  14. // Adds support for PIC32 Peripheral library functions and macros
  15. #include <plib.h>
  16. static void delay(void)
  17. {
  18. volatile unsigned long i;
  19. for(i=0;i<500000;i++);
  20. }
  21. int rt_application_init(void)
  22. {
  23. PORTSetPinsDigitalOut(IOPORT_D, BIT_0);
  24. while(1)
  25. {
  26. delay();
  27. delay();
  28. delay();
  29. delay();
  30. delay();
  31. delay();
  32. delay();
  33. delay();
  34. delay();
  35. delay();
  36. delay();
  37. delay();
  38. delay();
  39. delay();
  40. PORTSetBits(IOPORT_D, BIT_0);
  41. delay();
  42. PORTClearBits(IOPORT_D, BIT_0);
  43. }
  44. return 0;
  45. }