Skip to content

Commit

Permalink
[FL-2256] USB Service (flipperdevices#998)
Browse files Browse the repository at this point in the history
* usb service, removed power observer
* fix usb restart after disable
* remove usb service from apps
* Applcations: remove dead extern
* New thread naming scheme for drivers
* New thread symbol naming scheme for drivers

Co-authored-by: あく <[email protected]>
  • Loading branch information
nminaylov and skotopes authored Feb 16, 2022
1 parent a37f1d0 commit 2422419
Show file tree
Hide file tree
Showing 17 changed files with 356 additions and 286 deletions.
5 changes: 0 additions & 5 deletions applications/applications.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ extern int32_t gui_srv(void* p);
extern int32_t input_srv(void* p);
extern int32_t loader_srv(void* p);
extern int32_t notification_srv(void* p);
extern int32_t power_observer_srv(void* p);
extern int32_t power_srv(void* p);
extern int32_t storage_srv(void* p);
extern int32_t desktop_srv(void* p);
Expand Down Expand Up @@ -115,10 +114,6 @@ const FlipperApplication FLIPPER_SERVICES[] = {
{.app = power_srv, .name = "PowerSrv", .stack_size = 1024, .icon = NULL},
#endif

#ifdef SRV_POWER_OBSERVER
{.app = power_observer_srv, .name = "PowerAuditSrv", .stack_size = 1024, .icon = NULL},
#endif

#ifdef SRV_STORAGE
{.app = storage_srv, .name = "StorageSrv", .stack_size = 3072, .icon = NULL},
#endif
Expand Down
8 changes: 0 additions & 8 deletions applications/applications.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ SRV_INPUT = 1
SRV_LOADER = 1
SRV_NOTIFICATION = 1
SRV_POWER = 1
SRV_POWER_OBSERVER = 1
SRV_RPC = 1
SRV_STORAGE = 1

Expand Down Expand Up @@ -256,13 +255,6 @@ endif
endif


SRV_POWER_OBSERVER ?= 0
ifeq ($(SRV_POWER_OBSERVER), 1)
CFLAGS += -DSRV_POWER_OBSERVER
SRV_POWER = 1
endif


SRV_POWER ?= 0
ifeq ($(SRV_POWER), 1)
CFLAGS += -DSRV_POWER
Expand Down
5 changes: 5 additions & 0 deletions applications/power/power_service/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ int32_t power_srv(void* p) {
// Update battery view port
if(need_refresh) view_port_update(power->battery_view_port);

// Check OTG status and disable it in case of fault
if(furi_hal_power_is_otg_enabled()) {
furi_hal_power_check_otg_status();
}

osDelay(1000);
}

Expand Down
76 changes: 0 additions & 76 deletions applications/power_observer/power_observer.c

This file was deleted.

2 changes: 1 addition & 1 deletion firmware/targets/f6/ble_glue/ble_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool ble_app_init() {
ble_app->event_flags = osEventFlagsNew(NULL);
// HCI transport layer thread to handle user asynch events
ble_app->thread = furi_thread_alloc();
furi_thread_set_name(ble_app->thread, "BleHciWorker");
furi_thread_set_name(ble_app->thread, "BleHciDriver");
furi_thread_set_stack_size(ble_app->thread, 1024);
furi_thread_set_context(ble_app->thread, ble_app);
furi_thread_set_callback(ble_app->thread, ble_app_hci_thread);
Expand Down
2 changes: 1 addition & 1 deletion firmware/targets/f6/ble_glue/ble_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void ble_glue_init() {

// FreeRTOS system task creation
ble_glue->thread = furi_thread_alloc();
furi_thread_set_name(ble_glue->thread, "BleShciWorker");
furi_thread_set_name(ble_glue->thread, "BleShciDriver");
furi_thread_set_stack_size(ble_glue->thread, 1024);
furi_thread_set_context(ble_glue->thread, ble_glue);
furi_thread_set_callback(ble_glue->thread, ble_glue_shci_thread);
Expand Down
2 changes: 1 addition & 1 deletion firmware/targets/f6/ble_glue/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ bool gap_init(GapConfig* config, GapEventCallback on_event_cb, void* context) {

// Thread configuration
gap->thread = furi_thread_alloc();
furi_thread_set_name(gap->thread, "BleGapWorker");
furi_thread_set_name(gap->thread, "BleGapDriver");
furi_thread_set_stack_size(gap->thread, 1024);
furi_thread_set_context(gap->thread, gap);
furi_thread_set_callback(gap->thread, gap_app);
Expand Down
1 change: 0 additions & 1 deletion firmware/targets/f6/furi_hal/furi_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void furi_hal_init() {

// VCP + USB
furi_hal_usb_init();
furi_hal_usb_set_config(&usb_cdc_single);
furi_hal_vcp_init();
FURI_LOG_I(TAG, "USB OK");

Expand Down
Loading

0 comments on commit 2422419

Please sign in to comment.