コード例 #1
0
ファイル: main.c プロジェクト: anantmk/I2CServoDrive
void initIO(void)
{
    //SET OUTPUTS
    
    //Servo channels as outputs
    
    DDRB |= (1 << PIN0) | (1 << PIN1) | (1 << PIN2) | (1 << PIN3) | (1 << PIN4);
    DDRD |= (1 << PIN0) | (1 << PIN1) | (1 << PIN2) | (1 << PIN3) | (1 << PIN4) | (1 << PIN5) | (1 << PIN6);
    
    //LED as ouput
    DDRB |= (1 << PIN6);
    
    //LED on
    PORTB |= (1 << PIN6);
    
    _delay_ms(500);
    
    PORTB &= ~(1 << PIN6);
    
    InitTimer1();
    
    StartTimer1();
    
    cli();  // Disable interrupts
    
    usiTwiSlaveInit(SLAVE_ADDR_ATTINY);	// TWI slave init
    
    sei();  // Re-enable interrupts
}
コード例 #2
0
ファイル: syspreinit.c プロジェクト: kelsieflynn/coreboot-1
void SystemPreInit(void)
{
    /* they want a jump ... */
#ifndef CONFIG_CACHE_AS_RAM
    __asm__ __volatile__("jmp .+2\ninvd\njmp .+2\n");
#endif
    StartTimer1();
}
コード例 #3
0
ファイル: coax_rc.c プロジェクト: redbaron148/siue_coax_dev
int RCInitReception(int blocking)
{
    InitTimer1();               // Initialize and start timer 1
    StopTimer1();               // Stop timer
    RC_reset = 1;               // Reset the Cypress
    DS_CS_2 = 1;               // Deselect the Cypress
    activeChannelIndex=0;         // 
    rcState = RC_LOWLEVEL_RESET1;
    StartTimer1();               // Start timer
    if (blocking) {
        while (rcState != RC_LOWLEVEL_RUNNING) {
            // Nothing to do but wait...
        }
    }
    return 0;
}
コード例 #4
0
void SystemPreInit(void)
{
	/* they want a jump ... */
	StartTimer1();
}