Example #1
0
void initVariant( void )
{
    /* Initialise CDC-ACM shared buffers pointers, provided by LMT */
    Serial.setSharedData(shared_data->cdc_acm_buffers);

    /* For now, lets enable clocks for all interfaces we need
     * TODO - Consider only enabling as needed later to reduce power consumption
     */
    variantGpioInit();
    variantPwmInit();
    variantAdcInit();

    cfw_platform_init();
    
    // Add for debug corelib
    #ifdef CONFIGURE_DEBUG_CORELIB_ENABLED
    log_init();
    #endif
}
void initVariant( void )
{
    /* Initialise CDC-ACM shared buffers pointers, provided by LMT */
    Serial.setSharedData(shared_data->cdc_acm_buffers);

    /* For now, lets enable clocks for all interfaces we need
     * TODO - Consider only enabling as needed later to reduce power consumption
     */
    variantGpioInit();
    variantPwmInit();
    variantAdcInit();
    
    //set RTC clock divider to 32768(1 Hz)
    *SYS_CLK_CTL |= RTC_DIV_1HZ_MASK;
    *SYS_CLK_CTL &= ~(1 << CCU_RTC_CLK_DIV_EN);
    *SYS_CLK_CTL |= 1 << CCU_RTC_CLK_DIV_EN;
    
    cfw_platform_init();
    
    // Add for debug corelib
    #ifdef CONFIGURE_DEBUG_CORELIB_ENABLED
    log_init();
    #endif
}