static inline void mode_strobe(void) { while(1) { set_output(STROBE_ON_OUT, 0); delay_5ms(strobe_delay); set_output(STROBE_OFF_OUT, 0); delay_5ms(strobe_delay); } }
static inline void mode_program(void) { uint8_t i; uint8_t j = spress_cnt - PROGRAM_SPRESS; for (i = 0; i < PROGRAM_BLINKS; i++) { set_output(PROGRAM_OUT, 0); delay_5ms(PROGRAM_DELAY); set_output(0, 0); delay_5ms(PROGRAM_DELAY); } for (i = 0; i < 255;) { i++; set_output(0, 0); delay_5ms(PROGRAM_PAUSE); set_output(PROGRAM_OUT, 0); eeprom_write_byte((uint8_t *)(uint16_t)(j), i); delay_5ms(PROGRAM_PAUSE); } }
void main(void) { initialize_ports(); //initialize ports while(1){//main loop //new_PORTC = PINC; //read PORTC //if(new_PORTC != old_PORTC){ //process change // PORTD=new_PORTC; // } //end if new_PORTC // old_PORTC=new_PORTC; //update PORTC delay_5ms(); } //end while(1) } //end main