You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
854 B

3 years ago
  1. #include "test.h"
  2. #include "../zes8p5066lib/basic.h"
  3. void test_all_light(void) {
  4. static uint32_t lastprocess = 0;
  5. static uint8_t debug_led_state = 1;
  6. static int num;
  7. if (systicket_haspassedms(lastprocess) > 300) {
  8. lastprocess = systicket_get_now_ms();
  9. debug_led_state = !debug_led_state;
  10. num++;
  11. port_debug_set(debug_led_state);
  12. port_led0_set(debug_led_state);
  13. port_led1_set(debug_led_state);
  14. port_led2_set(debug_led_state);
  15. port_led3_set(debug_led_state);
  16. if (num % 3 == 0) {
  17. port_led_r_set(true);
  18. port_led_g_set(false);
  19. port_led_b_set(false);
  20. }
  21. if (num % 3 == 1) {
  22. port_led_r_set(false);
  23. port_led_g_set(true);
  24. port_led_b_set(false);
  25. }
  26. if (num % 3 == 2) {
  27. port_led_r_set(false);
  28. port_led_g_set(false);
  29. port_led_b_set(true);
  30. }
  31. }
  32. }