There are two methods:
1. You can use OPERATE_RET tkl_timer_start(TUYA_TIMER_NUM_E timer_id, UINT_T us) to delay us
2. You can also use a while loop or a for loop to customize a delay function DELAY_US(); delay a certain number of times to achieve the effect of delaying us, because the clock frequency of different chip platforms is different, the specific number of delays for 1us needs to be determined by actual testing. The routine is as follows:
#define TICK_US 7 //Here you need to set it according to your own chip platform, for example, BK7231N is about 7 times 1us
#define DELAY_US(us) \
do { \
volatile UINT_T i = us * TICK_US; \
while (i--); \
} while(0)