mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 15:04:19 +00:00
Merge branch 'ofw-dev' into dev
This commit is contained in:
commit
c00d758c1b
5 changed files with 36 additions and 20 deletions
|
@ -70,12 +70,10 @@ static void desktop_scene_main_open_app_or_profile(Desktop* desktop, const char*
|
|||
}
|
||||
|
||||
static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) {
|
||||
if(strlen(application->name_or_path) > 0) {
|
||||
if(strlen(application->name_or_path) > 2) {
|
||||
loader_start_with_gui_error(desktop->loader, application->name_or_path, NULL);
|
||||
} else {
|
||||
// No favourite app is set! So we skipping this part
|
||||
return;
|
||||
//status = loader_start(desktop->loader, FAP_LOADER_APP_NAME, NULL);
|
||||
} else if((strlen(application->name_or_path) < 2) && (application->is_external == true)) {
|
||||
loader_start(desktop->loader, LOADER_APPLICATIONS_NAME, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,9 +5,13 @@
|
|||
#include <storage/storage.h>
|
||||
#include <dialogs/dialogs.h>
|
||||
|
||||
#define EXTERNAL_BROWSER_NAME ("Applications")
|
||||
#define EXTERNAL_BROWSER_INDEX (FLIPPER_APPS_COUNT + 1)
|
||||
|
||||
#define EXTERNAL_APPLICATION_NAME ("[External Application]")
|
||||
#define EXTERNAL_APPLICATION_INDEX (FLIPPER_APPS_COUNT + 1)
|
||||
#define NONE_APPLICATION_INDEX (FLIPPER_APPS_COUNT + 2)
|
||||
#define EXTERNAL_APPLICATION_INDEX (FLIPPER_APPS_COUNT + 2)
|
||||
|
||||
#define NONE_APPLICATION_INDEX (FLIPPER_APPS_COUNT + 3)
|
||||
|
||||
static bool favorite_fap_selector_item_callback(
|
||||
FuriString* file_path,
|
||||
|
@ -71,14 +75,28 @@ void desktop_settings_scene_favorite_on_enter(void* context) {
|
|||
}
|
||||
}
|
||||
|
||||
// Special case: Application browser
|
||||
submenu_add_item(
|
||||
submenu,
|
||||
EXTERNAL_BROWSER_NAME,
|
||||
EXTERNAL_BROWSER_INDEX,
|
||||
desktop_settings_scene_favorite_submenu_callback,
|
||||
app);
|
||||
|
||||
// Special case: Specific application
|
||||
submenu_add_item(
|
||||
submenu,
|
||||
EXTERNAL_APPLICATION_NAME,
|
||||
EXTERNAL_APPLICATION_INDEX,
|
||||
desktop_settings_scene_favorite_submenu_callback,
|
||||
app);
|
||||
|
||||
if(curr_favorite_app->is_external) {
|
||||
pre_select_item = EXTERNAL_APPLICATION_INDEX;
|
||||
if(curr_favorite_app->name_or_path[0] == '\0') {
|
||||
pre_select_item = EXTERNAL_BROWSER_INDEX;
|
||||
} else {
|
||||
pre_select_item = EXTERNAL_APPLICATION_INDEX;
|
||||
}
|
||||
}
|
||||
|
||||
submenu_add_item(
|
||||
|
@ -124,7 +142,11 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e
|
|||
}
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == EXTERNAL_APPLICATION_INDEX) {
|
||||
if(event.event == EXTERNAL_BROWSER_INDEX) {
|
||||
curr_favorite_app->is_external = true;
|
||||
curr_favorite_app->name_or_path[0] = '\0';
|
||||
consumed = true;
|
||||
} else if(event.event == EXTERNAL_APPLICATION_INDEX) {
|
||||
const DialogsFileBrowserOptions browser_options = {
|
||||
.extension = ".fap",
|
||||
.icon = &I_unknown_10px,
|
||||
|
@ -151,7 +173,7 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e
|
|||
}
|
||||
} else if(event.event == NONE_APPLICATION_INDEX) {
|
||||
curr_favorite_app->is_external = false;
|
||||
strncpy(curr_favorite_app->name_or_path, "no", MAX_APP_LENGTH);
|
||||
strncpy(curr_favorite_app->name_or_path, "n", MAX_APP_LENGTH);
|
||||
consumed = true;
|
||||
} else {
|
||||
curr_favorite_app->is_external = false;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f71c4b7f750f2539a1fed08925d8da3abdc80ff9
|
||||
Subproject commit 08a907d95733600becc41c0602ef5ee4c4baf782
|
|
@ -378,9 +378,6 @@ static void furi_hal_infrared_configure_tim_pwm_tx(uint32_t freq, float duty_cyc
|
|||
LL_TIM_EnableAllOutputs(INFRARED_DMA_TIMER);
|
||||
LL_TIM_DisableIT_UPDATE(INFRARED_DMA_TIMER);
|
||||
LL_TIM_EnableDMAReq_UPDATE(INFRARED_DMA_TIMER);
|
||||
|
||||
NVIC_SetPriority(TIM1_UP_TIM16_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 5, 0));
|
||||
NVIC_EnableIRQ(TIM1_UP_TIM16_IRQn);
|
||||
}
|
||||
|
||||
static void furi_hal_infrared_configure_tim_cmgr2_dma_tx(void) {
|
||||
|
|
|
@ -62,7 +62,7 @@ const IRQn_Type furi_hal_interrupt_irqn[FuriHalInterruptIdMax] = {
|
|||
|
||||
__attribute__((always_inline)) static inline void
|
||||
furi_hal_interrupt_call(FuriHalInterruptId index) {
|
||||
furi_assert(furi_hal_interrupt_isr[index].isr);
|
||||
furi_check(furi_hal_interrupt_isr[index].isr);
|
||||
furi_hal_interrupt_isr[index].isr(furi_hal_interrupt_isr[index].context);
|
||||
}
|
||||
|
||||
|
@ -127,16 +127,15 @@ void furi_hal_interrupt_set_isr_ex(
|
|||
uint16_t priority,
|
||||
FuriHalInterruptISR isr,
|
||||
void* context) {
|
||||
furi_assert(index < FuriHalInterruptIdMax);
|
||||
furi_assert(priority < 15);
|
||||
furi_assert(furi_hal_interrupt_irqn[index]);
|
||||
furi_check(index < FuriHalInterruptIdMax);
|
||||
furi_check(priority < 15);
|
||||
|
||||
if(isr) {
|
||||
// Pre ISR set
|
||||
furi_assert(furi_hal_interrupt_isr[index].isr == NULL);
|
||||
furi_check(furi_hal_interrupt_isr[index].isr == NULL);
|
||||
} else {
|
||||
// Pre ISR clear
|
||||
furi_assert(furi_hal_interrupt_isr[index].isr != NULL);
|
||||
furi_check(furi_hal_interrupt_isr[index].isr != NULL);
|
||||
furi_hal_interrupt_disable(index);
|
||||
furi_hal_interrupt_clear_pending(index);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue