You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// struct size check, do not modify ======================================================================================================================================
127
145
#defineTSMASTER_VERSION"2021.6.22.581"// do not modify this version as it depends on TSMaster implementation !
128
146
if (!AReg(AObj, "check_mp_internal", "version", TSMASTER_VERSION, 0, "")) return -1;
129
147
if (!AReg(AObj, "check_mp_internal", "struct_size", "struct_size_app", (void *)sizeof(TTSMasterConfiguration), "")) return -1;
if (!AReg(AObj, "check_mp_internal", "struct_size", "struct_size_TMPVarLIN", (void *)sizeof(TMPVarLIN), "")) return -1;
139
157
if (!AReg(AObj, "check_mp_internal", "struct_size", "struct_size_TLIBTSMapping", (void *)sizeof(TLIBTSMapping), "")) return -1;
140
158
if (!AReg(AObj, "check_mp_internal", "struct_size", "struct_size_TLIBSystemVarDef", (void *)sizeof(TLIBSystemVarDef), "")) return -1;
141
-
if (!AReg(AObj, "step_function", "step", "5", &step, "")) return -1;
142
-
// add your custom functions here
159
+
// step function will run with 500 ms interval ============================================================================================================================
160
+
if (!AReg(AObj, "step_function", "step", "500", &step, "")) return -1;
161
+
// Mini program variables will be registered here, 0: integer; 1: double; 2: string; 3: TCAN; 4: TCANFD; 5: TLIN ==========================================================
162
+
if (!AReg(AObj, "var", "NewVariable1", "0", &NewVariable1, "")) return -1;
163
+
// Timers can be defined here, 100 means interval = 100ms =================================================================================================================
164
+
if (!AReg(AObj, "timer", "NewTimer1", "100", &NewTimer1, "")) return -1;
165
+
// CAN receive done callback will be registered here, 291: identifier; -1: standard frame and 0 means extended frame; -1: can fd frame and 0 means classical can frame ====
166
+
if (!AReg(AObj, "on_can_rx_callback", "on_canfd_rx_NewOn_CAN_Rx1", "291,-1,-1", &on_canfd_rx_NewOn_CAN_Rx1, "")) return -1;
167
+
// CAN transmit done callback will be registered here, 291: identifier; -1: standard frame and 0 means extended frame; -1: can fd frame and 0 means classical can frame ===
168
+
if (!AReg(AObj, "on_can_tx_callback", "on_canfd_tx_NewOn_CAN_Tx1", "291,-1,-1", &on_canfd_tx_NewOn_CAN_Tx1, "")) return -1;
169
+
// CAN pre-transmit callback will be registered here, 291: identifier; -1: standard frame and 0 means extended frame; -1: can fd frame and 0 means classical can frame ====
170
+
if (!AReg(AObj, "on_can_pretx_callback", "on_canfd_pretx_NewOn_CAN_PreTx1", "291,-1,-1", &on_canfd_pretx_NewOn_CAN_PreTx1, "")) return -1;
171
+
// LIN receive done callback will be registered here, 18: identifier ======================================================================================================
172
+
if (!AReg(AObj, "on_lin_rx_callback", "on_lin_rx_NewOn_LIN_Rx1", "18", &on_lin_rx_NewOn_LIN_Rx1, "")) return -1;
173
+
// LIN transmit done callback will be registered here, 18: identifier =====================================================================================================
174
+
if (!AReg(AObj, "on_lin_tx_callback", "on_lin_tx_NewOn_LIN_Tx1", "18", &on_lin_tx_NewOn_LIN_Tx1, "")) return -1;
175
+
// LIN pre-transmit callback will be registered here, 18: identifier ======================================================================================================
176
+
if (!AReg(AObj, "on_lin_pretx_callback", "on_lin_pretx_NewOn_LIN_PreTx1", "18", &on_lin_pretx_NewOn_LIN_PreTx1, "")) return -1;
177
+
// Mini program variable change callback will be registered here ==========================================================================================================
178
+
if (!AReg(AObj, "on_var_change_callback", "on_var_change_NewOn_Var_Change1", "NewVariable1", &on_var_change_NewOn_Var_Change1, "")) return -1;
179
+
// Timer overflow callback will be registered here ========================================================================================================================
180
+
if (!AReg(AObj, "on_timer_callback", "on_timer_NewOn_Timer1", "NewTimer1", &on_timer_NewOn_Timer1, "")) return -1;
181
+
// Mini program start callback will be registered here ====================================================================================================================
182
+
if (!AReg(AObj, "on_start_callback", "on_start_NewOn_Start1", "", &on_start_NewOn_Start1, "")) return -1;
183
+
// Mini program stop callback will be registered here =====================================================================================================================
184
+
if (!AReg(AObj, "on_stop_callback", "on_stop_NewOn_Stop1", "", &on_stop_NewOn_Stop1, "")) return -1;
185
+
// Short-cut key callback will be registered here =========================================================================================================================
186
+
if (!AReg(AObj, "on_shortcut_callback", "on_shortcut_NewOn_Shortcut1", "Ctrl+R", &on_shortcut_NewOn_Shortcut1, "")) return -1;
187
+
// add your custom functions here =========================================================================================================================================
143
188
if (!AReg(AObj, "on_custom_callback", "func1", "const s32 A1, const s32 A2", &func1, "this is a demo api")) return -1;
0 commit comments