main.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #include "ch.h"
  14. /*
  15. * Blinker thread #1.
  16. */
  17. static THD_WORKING_AREA(waThread1, 128);
  18. static THD_FUNCTION(Thread1, arg) {
  19. (void)arg;
  20. while (true) {
  21. chThdSleepMilliseconds(1000);
  22. }
  23. }
  24. /*
  25. * Threads static table, one entry per thread. The number of entries must
  26. * match NIL_CFG_NUM_THREADS.
  27. */
  28. THD_TABLE_BEGIN
  29. THD_TABLE_ENTRY(waThread1, "sleeper", Thread1, NULL)
  30. THD_TABLE_END
  31. /*
  32. * Application entry point.
  33. */
  34. int main(void) {
  35. /*
  36. * System initializations.
  37. * - Kernel initialization, the main() function becomes a thread and the
  38. * RTOS is active.
  39. */
  40. chSysInit();
  41. /* This is now the idle thread loop, you may perform here a low priority
  42. task but you must never try to sleep or wait in this loop. Note that
  43. this tasks runs at the lowest priority level so any instruction added
  44. here will be executed after all other tasks have been started.*/
  45. while (true) {
  46. }
  47. }