forked from Mirrors/usk
publish
This commit is contained in:
parent
cae7779fa1
commit
5617e8cfec
2 changed files with 11 additions and 1 deletions
7
misc.c
7
misc.c
|
|
@ -116,7 +116,12 @@ void put_pixel(uint32_t pixel_grb)
|
|||
gpio_put(pwr_pin(), 1);
|
||||
sleep_us(200);
|
||||
}
|
||||
pio_sm_put_blocking(pio0, 3, pixel_grb << 8u);
|
||||
|
||||
uint8_t green = (pixel_grb >> 16) & 0xFF;
|
||||
uint8_t red = (pixel_grb >> 8) & 0xFF;
|
||||
uint8_t blue = pixel_grb & 0xFF;
|
||||
|
||||
pio_sm_put_blocking(pio0, 3, (green << 16) | (red << 8) | blue);
|
||||
sleep_us(50);
|
||||
pio_sm_set_enabled(pio0, 3, false);
|
||||
gpio_init(led_pin());
|
||||
|
|
|
|||
5
misc.h
5
misc.h
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
void put_pixel(uint32_t pixel_grb);
|
||||
|
||||
uint8_t red = (pixel_grb >> 8) & 0xFF;
|
||||
uint8_t green = (pixel_grb >> 16) & 0xFF;
|
||||
uint8_t blue = pixel_grb & 0xFF;
|
||||
|
||||
|
||||
void halt_with_error(uint32_t err, uint32_t bits);
|
||||
|
||||
void gpio_disable_input_output(int pin);
|
||||
|
|
|
|||
Loading…
Reference in a new issue