mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 09:58:36 -07:00
Format + cleanup
This commit is contained in:
@@ -92,7 +92,7 @@ static void findmy_start(FindMy* app) {
|
|||||||
uint8_t* it = data;
|
uint8_t* it = data;
|
||||||
|
|
||||||
// For Apple AirTags
|
// For Apple AirTags
|
||||||
*it++ = 0x1E, // Length
|
*it++ = 0x1E; // Length
|
||||||
*it++ = 0xFF; // Manufacturer Specific Data
|
*it++ = 0xFF; // Manufacturer Specific Data
|
||||||
*it++ = 0x4C; // Company ID (Apple, Inc.)
|
*it++ = 0x4C; // Company ID (Apple, Inc.)
|
||||||
*it++ = 0x00; // State
|
*it++ = 0x00; // State
|
||||||
|
|||||||
@@ -58,7 +58,12 @@ void findmy_scene_config_on_enter(void* context) {
|
|||||||
variable_item_set_current_value_text(item, transmit_power_s);
|
variable_item_set_current_value_text(item, transmit_power_s);
|
||||||
|
|
||||||
item = variable_item_list_add(var_item_list, "Register Tag", 0, NULL, NULL);
|
item = variable_item_list_add(var_item_list, "Register Tag", 0, NULL, NULL);
|
||||||
item = variable_item_list_add(var_item_list, "Matthew KuKanich, Thanks to Chapoly1305, WillyJL, OpenHaystack, Testers", 1, NULL, NULL);
|
item = variable_item_list_add(
|
||||||
|
var_item_list,
|
||||||
|
"Matthew KuKanich, Thanks to Chapoly1305, WillyJL, OpenHaystack, Testers",
|
||||||
|
1,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
variable_item_set_current_value_text(item, "Credits");
|
variable_item_set_current_value_text(item, "Credits");
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(var_item_list, findmy_scene_config_callback, app);
|
variable_item_list_set_enter_callback(var_item_list, findmy_scene_config_callback, app);
|
||||||
|
|||||||
@@ -56,5 +56,4 @@ void findmy_scene_config_mac_on_exit(void* context) {
|
|||||||
|
|
||||||
byte_input_set_result_callback(app->byte_input, NULL, NULL, NULL, NULL, 0);
|
byte_input_set_result_callback(app->byte_input, NULL, NULL, NULL, NULL, 0);
|
||||||
byte_input_set_header_text(app->byte_input, "");
|
byte_input_set_header_text(app->byte_input, "");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,8 @@ bool findmy_scene_config_packet_on_event(void* context, SceneManagerEvent event)
|
|||||||
case ByteInputResultOk:
|
case ByteInputResultOk:
|
||||||
scene_manager_search_and_switch_to_previous_scene(
|
scene_manager_search_and_switch_to_previous_scene(
|
||||||
app->scene_manager, FindMySceneConfig);
|
app->scene_manager, FindMySceneConfig);
|
||||||
furi_check(furi_hal_bt_extra_beacon_set_data(app->packet_buf, sizeof(app->packet_buf)));
|
furi_check(
|
||||||
|
furi_hal_bt_extra_beacon_set_data(app->packet_buf, sizeof(app->packet_buf)));
|
||||||
if(app->packet_buf[0] == 0x1E && app->packet_buf[3] == 0x00) {
|
if(app->packet_buf[0] == 0x1E && app->packet_buf[3] == 0x00) {
|
||||||
app->apple = true; // Checks payload data for Apple identifier
|
app->apple = true; // Checks payload data for Apple identifier
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -56,30 +56,32 @@ static bool findmy_main_input_callback(InputEvent* event, void* context) {
|
|||||||
|
|
||||||
if(event->type == InputTypePress) {
|
if(event->type == InputTypePress) {
|
||||||
consumed = true;
|
consumed = true;
|
||||||
// FIXME: finish implementing handlers in scene side
|
FindMyMainEvent event;
|
||||||
|
|
||||||
switch(event->key) {
|
switch(event->key) {
|
||||||
case InputKeyBack:
|
case InputKeyBack:
|
||||||
findmy_main->callback(FindMyMainEventQuit, findmy_main->context);
|
event = FindMyMainEventQuit;
|
||||||
// furi_hal_bt_extra_beacon_stop();
|
|
||||||
break;
|
break;
|
||||||
case InputKeyOk:
|
case InputKeyOk:
|
||||||
findmy_main->callback(FindMyMainEventToggle, findmy_main->context);
|
event = FindMyMainEventToggle;
|
||||||
break;
|
break;
|
||||||
case InputKeyLeft:
|
case InputKeyLeft:
|
||||||
findmy_main->callback(FindMyMainEventBackground, findmy_main->context);
|
event = FindMyMainEventBackground;
|
||||||
break;
|
break;
|
||||||
case InputKeyRight:
|
case InputKeyRight:
|
||||||
findmy_main->callback(FindMyMainEventConfig, findmy_main->context);
|
event = FindMyMainEventConfig;
|
||||||
break;
|
break;
|
||||||
case InputKeyUp:
|
case InputKeyUp:
|
||||||
findmy_main->callback(FindMyMainEventIntervalUp, findmy_main->context);
|
event = FindMyMainEventIntervalUp;
|
||||||
break;
|
break;
|
||||||
case InputKeyDown:
|
case InputKeyDown:
|
||||||
findmy_main->callback(FindMyMainEventIntervalDown, findmy_main->context);
|
event = FindMyMainEventIntervalDown;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
return consumed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findmy_main->callback(event, findmy_main->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
return consumed;
|
return consumed;
|
||||||
|
|||||||
Reference in New Issue
Block a user