2020-10-26 10:16:54 +03:00
|
|
|
#include "flipper_v2.h"
|
2020-08-26 04:56:33 +03:00
|
|
|
|
2020-11-19 15:25:32 +03:00
|
|
|
void rgb_set(
|
|
|
|
bool r,
|
|
|
|
bool g,
|
|
|
|
bool b,
|
|
|
|
const GpioPin* led_r,
|
|
|
|
const GpioPin* led_g,
|
|
|
|
const GpioPin* led_b) {
|
2020-11-07 11:42:00 +03:00
|
|
|
gpio_write(led_r, !r);
|
|
|
|
gpio_write(led_g, !g);
|
|
|
|
gpio_write(led_b, !b);
|
|
|
|
}
|
|
|
|
|
2020-08-26 04:56:33 +03:00
|
|
|
void application_blink(void* p) {
|
2020-10-26 10:16:54 +03:00
|
|
|
// TODO open record
|
2020-11-19 15:25:32 +03:00
|
|
|
const GpioPin* led_r_record = &led_gpio[0];
|
|
|
|
const GpioPin* led_g_record = &led_gpio[1];
|
|
|
|
const GpioPin* led_b_record = &led_gpio[2];
|
2020-10-26 10:16:54 +03:00
|
|
|
|
2020-08-26 04:56:33 +03:00
|
|
|
// configure pin
|
2020-11-07 11:42:00 +03:00
|
|
|
gpio_init(led_r_record, GpioModeOutputOpenDrain);
|
|
|
|
gpio_init(led_g_record, GpioModeOutputOpenDrain);
|
|
|
|
gpio_init(led_b_record, GpioModeOutputOpenDrain);
|
2020-08-26 04:56:33 +03:00
|
|
|
|
|
|
|
while(1) {
|
2020-11-07 11:42:00 +03:00
|
|
|
rgb_set(1, 0, 0, led_r_record, led_g_record, led_b_record);
|
|
|
|
delay(500);
|
|
|
|
rgb_set(0, 1, 0, led_r_record, led_g_record, led_b_record);
|
|
|
|
delay(500);
|
|
|
|
rgb_set(1, 1, 0, led_r_record, led_g_record, led_b_record);
|
|
|
|
delay(500);
|
|
|
|
rgb_set(0, 0, 1, led_r_record, led_g_record, led_b_record);
|
|
|
|
delay(500);
|
|
|
|
rgb_set(1, 0, 1, led_r_record, led_g_record, led_b_record);
|
|
|
|
delay(500);
|
|
|
|
rgb_set(0, 1, 1, led_r_record, led_g_record, led_b_record);
|
|
|
|
delay(500);
|
|
|
|
rgb_set(1, 1, 1, led_r_record, led_g_record, led_b_record);
|
2020-08-26 04:56:33 +03:00
|
|
|
delay(500);
|
2020-11-07 11:42:00 +03:00
|
|
|
rgb_set(0, 0, 0, led_r_record, led_g_record, led_b_record);
|
2020-08-26 04:56:33 +03:00
|
|
|
delay(500);
|
|
|
|
}
|
|
|
|
}
|