From: Philipp Klaus Date: Thu, 13 Jul 2017 11:53:37 +0000 (+0200) Subject: ADCuC: whitespace fixes / 2spaces instead of tabs X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=c2394fa1a2984260ca9cb1a7e7753a57a1a86774;p=avr.git ADCuC: whitespace fixes / 2spaces instead of tabs --- diff --git a/atmega32u4/adcuc/main.c b/atmega32u4/adcuc/main.c index 0fb80c9..9f00fd5 100644 --- a/atmega32u4/adcuc/main.c +++ b/atmega32u4/adcuc/main.c @@ -18,7 +18,7 @@ //Select: PD5 //all commands end in \n -// cc -- channel address in hex +// cc -- channel address in hex //Scc(0|1|/) -- switch channel off/on/toggle //Scc? -- read channel status - 2nd char: 'e' in case of overcurrent, 3rd char: enable 1/0 //Ccc? -- read current @@ -92,13 +92,13 @@ void send_answer_hex(uint8_t chan, uint16_t v) { usb_serial_write(txbuf,8); usb_serial_flush_output(); } - - + + ISR(TIMER0_OVF_vect) { time++; asm volatile("wdr"); - } + } void getdata(uint8_t buf) { if (rxcnt != 0 || (buf == 'S' || buf == 'A' || buf == 'L' || buf == 'C' || buf == 'I' @@ -110,68 +110,66 @@ void getdata(uint8_t buf) { if (rxbuf[0] == 'A') { // do something } - - } + } } - if (rxcnt >= 7 || buf == '\n' || buf == '\r') { rxcnt = 0; } - } + if (rxcnt >= 7 || buf == '\n' || buf == '\r') { rxcnt = 0; } + } void original_value(uint8_t channel, uint8_t get_value_1, uint8_t get_value_2) { uint16_t result = (get_value_1 << 8) | get_value_2; - send_answer_hex(channel,result); -} - + send_answer_hex(channel,result); + } + void update_eeprom(void) { //etc... // eeprom_update_byte((uint8_t*)0x28,adc_enable); } void do_channel(uint8_t channel) { - uint8_t get_value_1; - uint8_t get_value_2; - if(channel<4) - ADC1_select(); - else - ADC2_select(); - SPDR = 0b11000011 + ((channel & 0b00000011) << 4); // MSB=Byte1 - while ((SPSR & (1<> 8) & 255) #if defined(__AVR_AT90USB162__) -#define HW_CONFIG() +#define HW_CONFIG() #define PLL_CONFIG() (PLLCSR = ((1<