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 }
void SystemPreInit(void) { /* they want a jump ... */ #ifndef CONFIG_CACHE_AS_RAM __asm__ __volatile__("jmp .+2\ninvd\njmp .+2\n"); #endif StartTimer1(); }
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; }
void SystemPreInit(void) { /* they want a jump ... */ StartTimer1(); }