mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 02:48:35 -07:00
New way of changing device name
Settings scene, char Validator, Idea -> by Willy-JL Implemented by me Kod plohoi, ochen plohoi, kto mozhet - sdelaite kak nado, esli smozhete :) Ya luche varianta ne pridumal poka 4to
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
#include <cli/cli.h>
|
||||
#include <cli/cli_vcp.h>
|
||||
|
||||
#include <toolbox/namechanger.h>
|
||||
#include <bt/bt_service/bt.h>
|
||||
|
||||
#include "animations/animation_manager.h"
|
||||
#include "desktop/scenes/desktop_scene.h"
|
||||
#include "desktop/scenes/desktop_scene_i.h"
|
||||
@@ -426,6 +429,26 @@ int32_t desktop_srv(void* p) {
|
||||
scene_manager_next_scene(desktop->scene_manager, DesktopSceneFault);
|
||||
}
|
||||
|
||||
// I added some very bydlo kod here, and thrown some delays to make it worse, pls don't look at it, it will make you cry from laugh
|
||||
if(furi_hal_rtc_get_boot_mode() == FuriHalRtcBootModeNormal) {
|
||||
if(NameChanger_Init()) {
|
||||
Cli* cli = furi_record_open(RECORD_CLI);
|
||||
cli_session_close(cli);
|
||||
furi_delay_ms(2);
|
||||
cli_session_open(cli, &cli_vcp);
|
||||
furi_record_close(RECORD_CLI);
|
||||
|
||||
furi_delay_ms(3);
|
||||
Bt* bt = furi_record_open(RECORD_BT);
|
||||
if(!bt_set_profile(bt, BtProfileSerial)) {
|
||||
FURI_LOG_D(TAG, "Failed to touch bluetooth to name change");
|
||||
}
|
||||
furi_record_close(RECORD_BT);
|
||||
bt = NULL;
|
||||
furi_delay_ms(3);
|
||||
}
|
||||
}
|
||||
|
||||
view_dispatcher_run(desktop->view_dispatcher);
|
||||
desktop_free(desktop);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void popup_free(Popup* popup);
|
||||
*/
|
||||
View* popup_get_view(Popup* popup);
|
||||
|
||||
/** Set popup header text
|
||||
/** Set popup callback function
|
||||
*
|
||||
* @param popup Popup instance
|
||||
* @param callback PopupCallback
|
||||
|
||||
Reference in New Issue
Block a user