Improvements for ws2812b_tester app
This commit is contained in:
parent
216c15dd77
commit
cafdbcc001
@ -23,6 +23,9 @@ This application has three submenu items:
|
|||||||
The "About" menu item contains information about the application.
|
The "About" menu item contains information about the application.
|
||||||
|
|
||||||
# Updates
|
# Updates
|
||||||
|
- Version 1.8
|
||||||
|
- Renamed app to fit on Flipper Zero main menu screen
|
||||||
|
- Improved initialization to only happen when configuring the LEDs
|
||||||
- Version 1.7
|
- Version 1.7
|
||||||
- Added blanking TRESET (LOW) signal before sending data to LEDs.
|
- Added blanking TRESET (LOW) signal before sending data to LEDs.
|
||||||
- Increased timer_buffer to uint16 to support blanking signal duration. Maybe there is a better way to do the initial low & save memory?
|
- Increased timer_buffer to uint16 to support blanking signal duration. Maybe there is a better way to do the initial low & save memory?
|
||||||
|
@ -249,6 +249,11 @@ static bool led_tester_custom_event_callback(void* context, uint32_t event) {
|
|||||||
LedTesterApp* app = (LedTesterApp*)context;
|
LedTesterApp* app = (LedTesterApp*)context;
|
||||||
const GpioPin* pin = setting_led_pin_values[app->model->led_pin_index];
|
const GpioPin* pin = setting_led_pin_values[app->model->led_pin_index];
|
||||||
|
|
||||||
|
if(!app->led_driver) {
|
||||||
|
FURI_LOG_E(TAG, "led_driver is NULL. Custom event %lu ignored.", event);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(event == LedTesterEventTimer) {
|
if(event == LedTesterEventTimer) {
|
||||||
app->model->timer_counter++;
|
app->model->timer_counter++;
|
||||||
}
|
}
|
||||||
@ -344,6 +349,11 @@ static bool led_tester_custom_event_callback(void* context, uint32_t event) {
|
|||||||
|
|
||||||
led_driver_transmit(app->led_driver, false);
|
led_driver_transmit(app->led_driver, false);
|
||||||
|
|
||||||
|
if(event == LedTesterEventDeinit) {
|
||||||
|
led_driver_free(app->led_driver);
|
||||||
|
app->led_driver = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,6 +372,8 @@ void led_tester_enter_leds_callback(void* _context) {
|
|||||||
app->timer = furi_timer_alloc(led_tester_timer_callback, FuriTimerTypePeriodic, app);
|
app->timer = furi_timer_alloc(led_tester_timer_callback, FuriTimerTypePeriodic, app);
|
||||||
furi_timer_start(app->timer, 250);
|
furi_timer_start(app->timer, 250);
|
||||||
view_dispatcher_send_custom_event(app->view_dispatcher, LedTesterEventInitialized);
|
view_dispatcher_send_custom_event(app->view_dispatcher, LedTesterEventInitialized);
|
||||||
|
app->led_driver =
|
||||||
|
led_driver_alloc(MAX_LED_COUNT, setting_led_pin_values[app->model->led_pin_index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -432,8 +444,6 @@ static LedTesterApp* led_tester_app_alloc() {
|
|||||||
variable_item_set_current_value_index(item, setting_led_pin_index);
|
variable_item_set_current_value_index(item, setting_led_pin_index);
|
||||||
variable_item_set_current_value_text(item, setting_led_pin_names[setting_led_pin_index]);
|
variable_item_set_current_value_text(item, setting_led_pin_names[setting_led_pin_index]);
|
||||||
app->model->led_pin_index = setting_led_pin_index;
|
app->model->led_pin_index = setting_led_pin_index;
|
||||||
app->led_driver =
|
|
||||||
led_driver_alloc(MAX_LED_COUNT, setting_led_pin_values[setting_led_pin_index]);
|
|
||||||
|
|
||||||
// Count
|
// Count
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
@ -530,7 +540,6 @@ static LedTesterApp* led_tester_app_alloc() {
|
|||||||
* @param app The led tester application object.
|
* @param app The led tester application object.
|
||||||
*/
|
*/
|
||||||
static void led_tester_app_free(LedTesterApp* app) {
|
static void led_tester_app_free(LedTesterApp* app) {
|
||||||
led_driver_free(app->led_driver);
|
|
||||||
view_dispatcher_remove_view(app->view_dispatcher, LedTesterViewAbout);
|
view_dispatcher_remove_view(app->view_dispatcher, LedTesterViewAbout);
|
||||||
widget_free(app->widget_about);
|
widget_free(app->widget_about);
|
||||||
view_dispatcher_remove_view(app->view_dispatcher, LedTesterViewLeds);
|
view_dispatcher_remove_view(app->view_dispatcher, LedTesterViewLeds);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
App(
|
App(
|
||||||
appid="ws2812b_tester_app",
|
appid="ws2812b_tester_app",
|
||||||
name="WS2812B LED Tester App",
|
name="WS2812B LED Tester",
|
||||||
apptype=FlipperAppType.EXTERNAL,
|
apptype=FlipperAppType.EXTERNAL,
|
||||||
entry_point="ws2812b_led_tester_app",
|
entry_point="ws2812b_led_tester_app",
|
||||||
fap_version=(1, 7),
|
fap_version=(1, 8),
|
||||||
stack_size=4 * 1024,
|
stack_size=4 * 1024,
|
||||||
requires=[
|
requires=[
|
||||||
"gui",
|
"gui",
|
||||||
|
Loading…
Reference in New Issue
Block a user