[FL-873] Add F5 target, lp5562 driver and api-hal-light (#347)

* Add F5 target, lp5562 driver and api-hal-light. Update api-usage, switch to F5 by default.
* API HAL: add i2c and hardware version api. Dolphin: show hardware version.
* OTP version generator and flashing utility.
* Assets script: fix code formatting
* Backport F5 changes to F4
* F4: disable insomnia, prevent damage to BLE RX path
* F5 HAL API Light: remove magic delay to fix magic BLE
* Dolphin: HW target validation on start
* invert RSSI indication in sub-1
* API HAL: rename board to body in version api
* Gpio tester: detach and release viewport on exit

Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
あく
2021-02-18 15:49:32 +03:00
committed by GitHub
parent da91482b7d
commit 68a3f6b4b7
214 changed files with 25577 additions and 184 deletions

View File

@@ -1,4 +1,6 @@
#include <furi.h>
#include <api-hal.h>
#include <gui/gui.h>
#include <input/input.h>
@@ -84,8 +86,6 @@ int32_t app_gpio_test(void* p) {
gpio_init((GpioPin*)&GPIO_PINS[i].pin, GpioModeOutputPushPull);
}
gpio_init((GpioPin*)&led_gpio[1], GpioModeOutputOpenDrain);
AppEvent event;
while(1) {
osStatus_t event_status = osMessageQueueGet(event_queue, &event, NULL, osWaitForever);
@@ -96,8 +96,13 @@ int32_t app_gpio_test(void* p) {
if(event.value.input.type == InputTypeShort &&
event.value.input.key == InputKeyBack) {
printf("[gpio-tester] bye!\r\n");
// TODO remove all view_ports create by app
api_hal_light_set(LightGreen, 0x00);
view_port_enabled_set(view_port, false);
gui_remove_view_port(gui, view_port);
view_port_free(view_port);
return 0;
}
@@ -118,10 +123,10 @@ int32_t app_gpio_test(void* p) {
if(event.value.input.key == InputKeyOk) {
if(event.value.input.type == InputTypePress) {
gpio_write((GpioPin*)&GPIO_PINS[state->gpio_index].pin, true);
gpio_write((GpioPin*)&led_gpio[1], false);
api_hal_light_set(LightGreen, 0xFF);
} else if(event.value.input.type == InputTypeRelease) {
gpio_write((GpioPin*)&GPIO_PINS[state->gpio_index].pin, false);
gpio_write((GpioPin*)&led_gpio[1], true);
api_hal_light_set(LightGreen, 0x00);
}
}
}