English
English
简体中文
Register
Log In
English
English
简体中文
Register
Log In
Language
English
English
简体中文
Register
Log In

What to do if TuyaOS BK7231N us delay is inaccurate?

Last Updated on2025-03-27 01:44:00
fiq interrupt and 32k interrupt may affect us delay. You can try to turn off fiq and 32k interrupt, but not more than 40 seconds, fiq (mainly used for network data transmission), 32k timer interrupt (used for thread scheduling) and shield interrupts of some other peripherals. The watchdog in TuyaOS will feed the dog once every 20 seconds, and it will restart if it is not fed for 3 times. If 32k and timer interrupt are turned off, remote scheduling cannot be performed, and the dog cannot be fed, causing the device to restart.
The interrupt function is defined as follows:
staticvoid__tdd_bk7231n_32k_enable(BK7231N_REG_T*reg_val)
{
if (0!=reg_val->val_32k) {
*(volatileunsignedlong*) (0x00802A00+0x13*4) |=reg_val->val_32k;
reg_val->val_32k=0;
    }
}
staticvoid__tdd_bk7231n_32k_disable(BK7231N_REG_T*reg_val)
{
if (0==reg_val->val_32k) {
reg_val->val_32k= (*(volatileunsignedlong*) (0x00802A00+0x13*4)) &0x7;
*(volatileunsignedlong*) (0x00802A00+0x13*4) &=0xFFFFFFF8;
    }
}
staticvoid__tdd_bk7231n_fiq_enable(void)
{
*(volatileunsignedlong*) (0x00802000+0x11*4) |=0x00000002;
return;
}
/**
 * @brief bk7231n fiq disable
 *
 * @param[in] none: none
 *
 * @return none
 */
staticvoid__tdd_bk7231n_fiq_disable(void)
{
*(volatileunsignedlong*) (0x00802000+0x11*4) &=0xFFFFFFFD;
return;
}

Click for services and help

Help Center