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.

44 lines
1.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #include "test.h"
  2. #include "port.h"
  3. #include "zes8p5066lib/basic.h"
  4. #include "zes8p5066lib/systicket.h"
  5. void test_all_light(void) {
  6. static uint32_t lastprocess = 0;
  7. static uint8_t debug_led_state = 1;
  8. static int num;
  9. if (systicket_haspassedms(lastprocess) > 1000) {
  10. lastprocess = systicket_get_now_ms();
  11. debug_led_state = !debug_led_state;
  12. num++;
  13. port_debug_set(debug_led_state);
  14. port_led0_set(debug_led_state);
  15. port_led1_set(debug_led_state);
  16. port_led2_set(debug_led_state);
  17. port_led3_set(debug_led_state);
  18. if (num % 4 == 0) {
  19. port_led_r_set(true);
  20. port_led_g_set(false);
  21. port_led_b_set(false);
  22. }
  23. if (num % 4 == 1) {
  24. port_led_r_set(false);
  25. port_led_g_set(true);
  26. port_led_b_set(false);
  27. }
  28. if (num % 4 == 2) {
  29. port_led_r_set(false);
  30. port_led_g_set(false);
  31. port_led_b_set(true);
  32. }
  33. if (num % 4 == 3) {
  34. port_led_r_set(false);
  35. port_led_g_set(false);
  36. port_led_b_set(false);
  37. }
  38. }
  39. }
  40. // printf("power:fan:%f,ozone:%f\n", port_adc_get_fan_power(), port_adc_get_ozone_generator_power());