File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
cubemx/UserLib/machine/Src Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,12 @@ error_code machine_start (struct command_machine* self)
100100
101101else
102102{
103- self -> uart_tx_cb ((uint8_t * )self -> current_command_window -> command_table [self -> command_index ] -> command_name ,
104- strlen (self -> current_command_window -> command_table [self -> command_index ] -> command_name ));
105- }
103+ if (self -> uart_tx_cb != NULL )
104+ {
105+ self -> uart_tx_cb ((uint8_t * )self -> current_command_window -> command_table [self -> command_index ] -> command_name ,
106+ strlen (self -> current_command_window -> command_table [self -> command_index ] -> command_name ));
107+ }
108+ }
106109
107110self -> timer = 1 ;
108111
@@ -260,8 +263,12 @@ error_code machine_loop (struct command_machine* self)
260263
261264else
262265{
263- self -> uart_tx_cb ((uint8_t * )self -> current_command_window -> command_table [self -> command_index ] -> command_name ,
264- strlen (self -> current_command_window -> command_table [self -> command_index ] -> command_name ));
266+ if (self -> uart_tx_cb != NULL )
267+ {
268+ self -> uart_tx_cb ((uint8_t * )self -> current_command_window -> command_table [self -> command_index ] -> command_name ,
269+ strlen (self -> current_command_window -> command_table [self -> command_index ] -> command_name ));
270+ }
271+
265272}
266273
267274self -> is_state_transition_available = 0 ;
You can’t perform that action at this time.
0 commit comments