T1-CHL_TuyaOS-3.8.31包含sys_ctrl.h文件编译提示错误

Wi-Fi 设备、Wi-Fi 低功耗设备、Wi-Fi BLE 双模设备、Ethernet设备、Ethernet+Wi-Fi设备等
Post Reply
小螃海
Posts: 49

请教大佬,要读取这个寄存器的值UINT32 wakeup_gpio = REG_READ(SCTRL_GPIO_WAKEUP_TYPE); 需要包含sys_ctrl.h头文件,编译后提示以下错误怎么解决
apps/19DWT_T1_exsxh/include/my_apps.h:14:13: fatal error: sys_ctrl.h: No such file or directory
14 | #include "sys_ctrl.h"//"../../../vendor/T1/T1_os/T1/driver/sys_ctrl/sys_ctrl.h"
| ~~~~~~~~


Tags:
小螃海
Posts: 49

Re: T1-CHL_TuyaOS-3.8.31包含sys_ctrl.h文件编译提示错误

给直接路径又提示SDK里面的arm_arch.h文件报错
apps/19DWT_T1_exsxh/include/../../../vendor/T1/T1_os/T1/driver/sys_ctrl/sys_ctrl.h:643:10: fatal error: arm_arch.h: No such file or directory
643 | #include "arm_arch.h"

JSHANG
Posts: 43

Re: T1-CHL_TuyaOS-3.8.31包含sys_ctrl.h文件编译提示错误

不要在你的应用代码直接调用底层的函数,这样会有头文件引用问题。
获取唤醒源,我们有在适配层有封装,tkl_wakeup.c里面接口tkl_wakeup_source_type_get:
/**

  • @brief wake up source get
    *

  • @param[out] param: wake up source get,
    *

  • @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
    */
    OPERATE_RET tkl_wakeup_source_type_get(TUYA_WAKEUP_SOURCE_BASE_CFG_T *param)
    {
    RESET_SOURCE_STATUS weke_up_way;

    if (NULL == param) {
    return OPRT_INVALID_PARM;
    }

    weke_up_way = sctrl_get_deep_sleep_wake_soure();
    if (RESET_SOURCE_DEEPPS_RTC == weke_up_way) {
    param->source = TUYA_WAKEUP_SOURCE_TIMER;
    } else if (RESET_SOURCE_DEEPPS_GPIO == weke_up_way) {
    param->source = TUYA_WAKEUP_SOURCE_GPIO;
    } else {
    param->source = TUYA_WAKEUP_SOURCE_MAX;
    }

    if (TUYA_WAKEUP_SOURCE_GPIO == param->source) {
    param->wakeup_para.gpio_param.gpio_num = bk_misc_wakeup_get_gpio_num();
    }

    //bk_printf("%s: weke_up_way %d source %d gpio_num %d\r\n",
    // func, weke_up_way, param->source, param->wakeup_para.gpio_param.gpio_num);
    return OPRT_OK;
    }

小螃海
Posts: 49

Re: T1-CHL_TuyaOS-3.8.31包含sys_ctrl.h文件编译提示错误

好的,谢谢,我试试

Post Reply