@@ -44,7 +44,7 @@ const char SettingsFld_ReadBatch[] = "RBatch:";
44
44
const char SettingsFld_WriteBatch [] = "WBatch:" ;
45
45
const char SettingsFld_SetBatch [] = "SBatch:" ;
46
46
const char SettingsFld_Listen [] = "Listen:" ;
47
- const char SettingsFld_ReadRepeatPeriod [] = "Read repeat:" ;
47
+ const char SettingsFld_ListenRepeatPeriod [] = "Listen repeat:" ;
48
48
const char AskQuestion_Save [] = "SAVE BATCH?" ;
49
49
#define Settings_i 'i'
50
50
#define Settings_n 'n'
@@ -95,7 +95,7 @@ uint8_t NRF_last_packet_send_st = 0;
95
95
uint8_t NRF_resend = 1 ; // number of transaction attempts
96
96
int8_t NRF_repeat = 0 ; // count number of repeated requests (until < NRF_resend)
97
97
uint32_t NRF_time ;
98
- uint16_t ReadRepeatPeriod = 10 ; // s
98
+ uint16_t ListenRepeatPeriod = 10 ; // s
99
99
bool ReadRepeat = false;
100
100
uint32_t delay_between_pkt = 10 ;// ms
101
101
@@ -854,8 +854,8 @@ static uint8_t load_settings_file() {
854
854
NRF_resend = str_to_int (p + sizeof (SettingsFld_Resend ));
855
855
} else if (strncmp (p , SettingsFld_Delay , sizeof (SettingsFld_Delay )- 1 ) == 0 ) {
856
856
delay_between_pkt = str_to_int (p + sizeof (SettingsFld_Delay ));
857
- } else if (strncmp (p , SettingsFld_ReadRepeatPeriod , sizeof (SettingsFld_ReadRepeatPeriod )- 1 ) == 0 ) {
858
- ReadRepeatPeriod = str_to_int (p + sizeof (SettingsFld_ReadRepeatPeriod ));
857
+ } else if (strncmp (p , SettingsFld_ListenRepeatPeriod , sizeof (SettingsFld_ListenRepeatPeriod )- 1 ) == 0 ) {
858
+ ListenRepeatPeriod = str_to_int (p + sizeof (SettingsFld_ListenRepeatPeriod ));
859
859
} else if (strncmp (p , SettingsFld_Payload , sizeof (SettingsFld_Payload )- 1 ) == 0 ) {
860
860
p += sizeof (SettingsFld_Payload );
861
861
payload_fields = 0 ;
@@ -1000,6 +1000,18 @@ static void input_callback(InputEvent* input_event, FuriMessageQueue* event_queu
1000
1000
furi_message_queue_put (event_queue , & event , FuriWaitForever );
1001
1001
}
1002
1002
1003
+ void display_remove_asterisk (char * fsp , uint8_t vx )
1004
+ {
1005
+ char * p2 = strchr (fsp , '*' );
1006
+ if (p2 ) { // remove '*' or '*n'
1007
+ int pos = p2 - fsp ;
1008
+ if ((pos -= vx ) < 0 ) pos = 0 ;
1009
+ char c = * (p2 + 1 );
1010
+ if (* (screen_buf + pos ))
1011
+ memmove (screen_buf + pos , screen_buf + pos + (c == ':' || c == '=' ? 1 : 2 ), FONT_5x7_SCREEN_WIDTH + 1 + 2 - pos );
1012
+ }
1013
+ }
1014
+
1003
1015
void render_display_list (Canvas * const canvas , FuriString * * * fsa , char delim , uint16_t view_pos , uint16_t max_i )
1004
1016
{
1005
1017
uint16_t page = view_pos & ~7 ;
@@ -1010,12 +1022,11 @@ void render_display_list(Canvas* const canvas, FuriString ***fsa, char delim, ui
1010
1022
p = (char * ) furi_string_get_cstr ((* fsa )[page + i ]);
1011
1023
end = strchr (p , delim );
1012
1024
if (end ) {
1013
- if (* (end - 1 ) == '*' ) end -- ; // skip *
1014
- else if (* (end - 2 ) == '*' ) end -= 2 ; // skip *?
1015
1025
len = MIN (end - p , view_x );
1016
1026
len = MIN (end - p - len , FONT_5x7_SCREEN_WIDTH );
1017
1027
strncpy (screen_buf , p + view_x , len );
1018
1028
screen_buf [len ] = '\0' ;
1029
+ display_remove_asterisk (p , MIN (end - p , view_x ));
1019
1030
canvas_draw_str (canvas , 5 , y , screen_buf );
1020
1031
}
1021
1032
if ((view_pos & 7 ) == i ) {
@@ -1025,16 +1036,6 @@ void render_display_list(Canvas* const canvas, FuriString ***fsa, char delim, ui
1025
1036
}
1026
1037
}
1027
1038
1028
- void display_remove_asterisk (char * fsp , uint8_t vx )
1029
- {
1030
- char * p2 = strchr (fsp , '*' );
1031
- if (p2 ) { // remove '*' or '*n'
1032
- int pos = p2 - fsp ;
1033
- if ((pos -= vx ) < 0 ) pos = 0 ;
1034
- memmove (screen_buf + pos , screen_buf + pos + (* (p2 + 1 ) == ':' ? 1 : 2 ), FONT_5x7_SCREEN_WIDTH + 1 + 2 );
1035
- }
1036
- }
1037
-
1038
1039
void display_edit_ttf_font (Canvas * const canvas , uint8_t start_x , uint8_t start_y )
1039
1040
{
1040
1041
screen_buf [0 ] = * Edit_pos ; screen_buf [1 ] = '\0' ;
@@ -1392,7 +1393,7 @@ int32_t nrf24batch_app(void* p) {
1392
1393
FuriLogLevel = furi_log_get_level ();
1393
1394
if (FuriLogLevel == FuriLogLevelDebug ) furi_hal_uart_set_br (FuriHalUartIdUSART1 , 1843200 );
1394
1395
}
1395
- if (what_doing == 2 && rw_type == rwt_read_cmd && ReadRepeat && furi_get_tick () - NRF_time > (uint32_t )(ReadRepeatPeriod * 1000 )) {
1396
+ if (what_doing == 2 && rw_type == rwt_read_cmd && ReadRepeat && furi_get_tick () - NRF_time > (uint32_t )(ListenRepeatPeriod * 1000 )) {
1396
1397
ERR = 0 ;
1397
1398
free_Log ();
1398
1399
Run_Read_cmd (Read_cmd [view_cmd [rwt_read_cmd ]]);
0 commit comments