Skip to content

Commit 28bbaaa

Browse files
author
David Lee
committed
Removed not needed settings Sound/Haptic
1 parent 06608e8 commit 28bbaaa

File tree

3 files changed

+19
-34
lines changed

3 files changed

+19
-34
lines changed

helpers/subghz/subghz.c

-7
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,18 @@
33
#include "subghz_i.h"
44
#include "../../helpers/xremote_custom_event.h"
55
#include "../../helpers/xremote_led.h"
6-
//#include "../meal_pager_storage.h"
76

87
SubGhz* subghz_alloc() {
98
SubGhz* subghz = malloc(sizeof(SubGhz));
109

1110
subghz->file_path = furi_string_alloc();
12-
1311
subghz->txrx = subghz_txrx_alloc();
1412

1513
return subghz;
1614
}
1715

1816
void subghz_free(SubGhz* subghz) {
19-
//TxRx
2017
subghz_txrx_free(subghz->txrx);
21-
22-
// Furi strings
2318
furi_string_free(subghz->file_path);
2419

2520
// The rest
@@ -55,7 +50,5 @@ void subghz_send(void* context, const char* path) {
5550
app->subghz->txrx, subghz_scene_transmit_callback_end_tx, app);
5651
app->state_notifications = SubGhzNotificationStateTx;
5752

58-
59-
6053
FURI_LOG_D(TAG, "Finished Transmitting");
6154
}

scenes/xremote_scene_settings.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
#include "../xremote.h"
22
#include <lib/toolbox/value_index.h>
3-
3+
/*
44
enum SettingsIndex {
55
SettingsIndexHaptic = 10,
66
SettingsIndexValue1,
77
SettingsIndexValue2,
8-
};
8+
};*/
99

10-
const char* const haptic_text[2] = {
10+
/*const char* const haptic_text[2] = {
1111
"OFF",
1212
"ON",
1313
};
1414
const uint32_t haptic_value[2] = {
1515
XRemoteHapticOff,
1616
XRemoteHapticOn,
17-
};
17+
};*/
1818

19-
const char* const speaker_text[2] = {
19+
/*const char* const speaker_text[2] = {
2020
"OFF",
2121
"ON",
2222
};
2323
const uint32_t speaker_value[2] = {
2424
XRemoteSpeakerOff,
2525
XRemoteSpeakerOn,
26-
};
26+
};*/
2727

2828
const char* const led_text[2] = {
2929
"OFF",
@@ -43,20 +43,20 @@ const uint32_t settings_value[2] = {
4343
XRemoteSettingsOn,
4444
};
4545

46-
static void xremote_scene_settings_set_haptic(VariableItem* item) {
46+
/*static void xremote_scene_settings_set_haptic(VariableItem* item) {
4747
XRemote* app = variable_item_get_context(item);
4848
uint8_t index = variable_item_get_current_value_index(item);
4949
5050
variable_item_set_current_value_text(item, haptic_text[index]);
5151
app->haptic = haptic_value[index];
52-
}
52+
}*/
5353

54-
static void xremote_scene_settings_set_speaker(VariableItem* item) {
54+
/*static void xremote_scene_settings_set_speaker(VariableItem* item) {
5555
XRemote* app = variable_item_get_context(item);
5656
uint8_t index = variable_item_get_current_value_index(item);
5757
variable_item_set_current_value_text(item, speaker_text[index]);
5858
app->speaker = speaker_value[index];
59-
}
59+
}*/
6060

6161
static void xremote_scene_settings_set_led(VariableItem* item) {
6262
XRemote* app = variable_item_get_context(item);
@@ -92,18 +92,18 @@ void xremote_scene_settings_on_enter(void* context) {
9292
uint8_t value_index;
9393

9494
// Vibro on/off
95-
item = variable_item_list_add(
95+
/* item = variable_item_list_add(
9696
app->variable_item_list, "Vibro/Haptic:", 2, xremote_scene_settings_set_haptic, app);
9797
value_index = value_index_uint32(app->haptic, haptic_value, 2);
9898
variable_item_set_current_value_index(item, value_index);
99-
variable_item_set_current_value_text(item, haptic_text[value_index]);
99+
variable_item_set_current_value_text(item, haptic_text[value_index]);*/
100100

101101
// Sound on/off
102-
item = variable_item_list_add(
102+
/* item = variable_item_list_add(
103103
app->variable_item_list, "Sound:", 2, xremote_scene_settings_set_speaker, app);
104104
value_index = value_index_uint32(app->speaker, speaker_value, 2);
105105
variable_item_set_current_value_index(item, value_index);
106-
variable_item_set_current_value_text(item, speaker_text[value_index]);
106+
variable_item_set_current_value_text(item, speaker_text[value_index]);*/
107107

108108
// LED Effects on/off
109109
item = variable_item_list_add(

scenes/xremote_scene_transmit.c

+5-13
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,8 @@ void xremote_scene_transmit_send_pause(XRemote* app, CrossRemoteItem* item) {
8282
void xremote_scene_transmit_send_subghz(XRemote* app, CrossRemoteItem* item) {
8383
app->transmitting = true;
8484
xremote_scene_ir_notification_message(app, SubGhzNotificationMessageBlinkStartSend);
85-
// ADD SEND METHOD HERE
86-
subghz_send(app, furi_string_get_cstr(item->filename)); //currently crashes, null pointer
87-
//furi_thread_flags_wait(0, FuriFlagWaitAny, 2000); //Remove later
88-
//app->transmitting = false;
89-
//xremote_scene_ir_notification_message(app, SubGhzNotificationMessageBlinkStop);
85+
subghz_send(app, furi_string_get_cstr(item->filename));
86+
//furi_thread_flags_wait(0, FuriFlagWaitAny, 2000);
9087
}
9188

9289
void xremote_scene_transmit_send_signal(void* context, CrossRemoteItem* item) {
@@ -109,8 +106,6 @@ void xremote_scene_transmit_send_signal(void* context, CrossRemoteItem* item) {
109106
} else if(item->type == XRemoteRemoteItemTypeSubGhz) {
110107
xremote_scene_transmit_send_subghz(app, item);
111108
}
112-
113-
//xremote_cross_remote_set_transmitting(remote, XRemoteTransmittingStop);
114109
}
115110

116111
void xremote_scene_transmit_run_remote(void* context) {
@@ -124,14 +119,12 @@ void xremote_scene_transmit_run_remote(void* context) {
124119
xremote_cross_remote_set_transmitting(remote, XRemoteTransmittingStart);
125120
CrossRemoteItem* item = xremote_cross_remote_get_item(remote, i);
126121
xremote_scene_transmit_send_signal(app, item);
127-
//furi_thread_flags_wait(0, FuriFlagWaitAny, 2000);
128122
//furi_thread_flags_wait(0, FuriFlagWaitAny, 1000);
129-
//xremote_scene_ir_notification_message(app, InfraredNotificationMessageBlinkStartSend);
130123
} else if(xremote_cross_remote_get_transmitting(remote) == XRemoteTransmittingStopSubghz) {
131124
i++;
132125
app->state_notifications = SubGhzNotificationStateIDLE;
133-
subghz_txrx_stop(app->subghz->txrx);
134126
app->transmitting = false;
127+
subghz_txrx_stop(app->subghz->txrx);
135128
xremote_scene_ir_notification_message(app, SubGhzNotificationMessageBlinkStop);
136129
xremote_cross_remote_set_transmitting(remote, XRemoteTransmittingIdle);
137130
//furi_thread_flags_wait(0, FuriFlagWaitAny, 1000);
@@ -142,7 +135,6 @@ void xremote_scene_transmit_run_remote(void* context) {
142135
}
143136
xremote_scene_ir_notification_message(app, InfraredNotificationMessageBlinkStop);
144137

145-
//scene_manager_next_scene(app->scene_manager, XRemoteSceneXrList);
146138
scene_manager_previous_scene(app->scene_manager);
147139
//xremote_transmit_model_set_name(app->xremote_transmit, xremote_cross_remote_get_name(remote));
148140
}
@@ -167,8 +159,8 @@ bool xremote_scene_transmit_on_event(void* context, SceneManagerEvent event) {
167159
FURI_LOG_D("SUBGHZ", "stop event");
168160
//app->stop_transmit = true;
169161
app->state_notifications = SubGhzNotificationStateIDLE;
170-
subghz_txrx_stop(app->subghz->txrx);
171162
app->transmitting = false;
163+
subghz_txrx_stop(app->subghz->txrx);
172164
xremote_scene_ir_notification_message(app, SubGhzNotificationMessageBlinkStop);
173165
xremote_cross_remote_set_transmitting(app->cross_remote, XRemoteTransmittingStop);
174166
break;
@@ -189,7 +181,7 @@ bool xremote_scene_transmit_on_event(void* context, SceneManagerEvent event) {
189181
void xremote_scene_transmit_on_exit(void* context) {
190182
XRemote* app = context;
191183
app->transmitting = false;
192-
subghz_txrx_stop(app->subghz->txrx);
193184
app->state_notifications = SubGhzNotificationStateIDLE;
185+
subghz_txrx_stop(app->subghz->txrx);
194186
//xremote_cross_remote_set_transmitting(remote, XRemoteTransmittingIdle);
195187
}

0 commit comments

Comments
 (0)