mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 06:14:14 +08:00
can-gps-v1:LED Trimming
This commit is contained in:
committed by
Daniel Agar
parent
54abd997de
commit
177109a1af
@@ -155,33 +155,33 @@ size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version)
|
||||
#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)}
|
||||
|
||||
typedef begin_packed_struct struct led_t {
|
||||
uint16_t red : 5;
|
||||
uint16_t green : 6;
|
||||
uint16_t blue : 5;
|
||||
uint8_t red;
|
||||
uint8_t green;
|
||||
uint8_t blue;
|
||||
uint8_t hz;
|
||||
} end_packed_struct led_t;
|
||||
|
||||
static const led_t i2l[] = {
|
||||
|
||||
led(0, off, 0, 0, 0, 0),
|
||||
led(1, reset, 10, 63, 31, 255),
|
||||
led(2, autobaud_start, 0, 63, 0, 1),
|
||||
led(3, autobaud_end, 0, 63, 0, 2),
|
||||
led(4, allocation_start, 0, 0, 31, 2),
|
||||
led(5, allocation_end, 0, 63, 31, 3),
|
||||
led(6, fw_update_start, 15, 63, 31, 3),
|
||||
led(7, fw_update_erase_fail, 15, 63, 15, 3),
|
||||
led(8, fw_update_invalid_response, 31, 0, 0, 1),
|
||||
led(9, fw_update_timeout, 31, 0, 0, 2),
|
||||
led(a, fw_update_invalid_crc, 31, 0, 0, 4),
|
||||
led(b, jump_to_app, 0, 63, 0, 10),
|
||||
led(0, off, 0, 0, 0, 0),
|
||||
led(1, reset, 128, 128, 128, 30),
|
||||
led(2, autobaud_start, 0, 128, 0, 1),
|
||||
led(3, autobaud_end, 0, 128, 0, 2),
|
||||
led(4, allocation_start, 0, 0, 64, 2),
|
||||
led(5, allocation_end, 0, 128, 64, 3),
|
||||
led(6, fw_update_start, 32, 128, 64, 3),
|
||||
led(7, fw_update_erase_fail, 32, 128, 32, 3),
|
||||
led(8, fw_update_invalid_response, 64, 0, 0, 1),
|
||||
led(9, fw_update_timeout, 64, 0, 0, 2),
|
||||
led(a, fw_update_invalid_crc, 64, 0, 0, 4),
|
||||
led(b, jump_to_app, 0, 128, 0, 10),
|
||||
|
||||
};
|
||||
|
||||
void board_indicate(uiindication_t indication)
|
||||
{
|
||||
rgb_led(i2l[indication].red << 3,
|
||||
i2l[indication].green << 2,
|
||||
i2l[indication].blue << 3,
|
||||
rgb_led(i2l[indication].red,
|
||||
i2l[indication].green,
|
||||
i2l[indication].blue,
|
||||
i2l[indication].hz);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user