Exemplo n.º 1
0
void drv_sys_init()
{
	FTRACE(("drv_sys_init()\n"));

    led_drv_init();

    uart_drv_init();
}
/* Basic Sensor IO initialization to be done here

	This function will be called only once during sensor registration
 */
int co2_sensor_init(struct sensor_info *curevent)
{
    int ret;

    if (co2_sinit_f)
        return 0;
    co2_sinit_f = 1;

    /* using IO_48 and IO_49 for Sensor Communication
    	Please NOTE:
    	This need relevent change in board file
     */
    uart_drv_init(UART2_ID, UART_8BIT);

    ret = os_mutex_create(&co2uart_mutex, "uart-co2",
                          OS_MUTEX_INHERIT);

    if (ret != WM_SUCCESS)
        return -WM_FAIL;

    uart2_dev = uart_drv_open(UART2_ID, CO2_UART_BAUD);

    return 0;
}