change spaces to tab
authorJochen Kiemes <jochen@kiemes.de>
Thu, 3 Jun 2021 16:18:50 +0000 (18:18 +0200)
committerJochen Kiemes <jochen@kiemes.de>
Thu, 3 Jun 2021 16:18:50 +0000 (18:18 +0200)
simavr/cores/sim_mega2560.h
simavr/cores/sim_megax8.h
simavr/sim/avr_timer.c

index 56a3450..f8a41a1 100644 (file)
@@ -385,14 +385,14 @@ const struct mcu_t {
                         },
                                // TIMER2_COMPB is only appeared in 2560
                         [AVR_TIMER_COMPB] = {
-                               .r_ocr = OCR2B,
-                               .com = AVR_IO_REGBITS(TCCR2A, COM2B0, 0x3),
-                               .com_pin = AVR_IO_REGBIT(PORTH, PH6),
-                               .interrupt = {
-                                       .enable = AVR_IO_REGBIT(TIMSK2, OCIE2B),
-                                       .raised = AVR_IO_REGBIT(TIFR2, OCF2B),
-                                       .vector = TIMER2_COMPB_vect,
-                               },
+                               .r_ocr = OCR2B,
+                               .com = AVR_IO_REGBITS(TCCR2A, COM2B0, 0x3),
+                               .com_pin = AVR_IO_REGBIT(PORTH, PH6),
+                               .interrupt = {
+                                       .enable = AVR_IO_REGBIT(TIMSK2, OCIE2B),
+                                       .raised = AVR_IO_REGBIT(TIFR2, OCF2B),
+                                       .vector = TIMER2_COMPB_vect,
+                               },
                         },
                },
        },
index ecb5971..3e2d6bf 100644 (file)
@@ -279,7 +279,7 @@ const struct mcu_t SIM_CORENAME = {
                                .r_ocrh = OCR1AH,       // 16 bits timers have two bytes of it
                                .com = AVR_IO_REGBITS(TCCR1A, COM1A0, 0x3),
                                .com_pin = AVR_IO_REGBIT(PORTB, 1),
-                .foc = AVR_IO_REGBIT(TCCR1C, FOC1A),
+                               .foc = AVR_IO_REGBIT(TCCR1C, FOC1A),
                                .interrupt = {
                                        .enable = AVR_IO_REGBIT(TIMSK1, OCIE1A),
                                        .raised = AVR_IO_REGBIT(TIFR1, OCF1A),
@@ -291,7 +291,7 @@ const struct mcu_t SIM_CORENAME = {
                                .r_ocrh = OCR1BH,
                                .com = AVR_IO_REGBITS(TCCR1A, COM1B0, 0x3),
                                .com_pin = AVR_IO_REGBIT(PORTB, 2),
-                .foc = AVR_IO_REGBIT(TCCR1C, FOC1B),
+                               .foc = AVR_IO_REGBIT(TCCR1C, FOC1B),
                                .interrupt = {
                                        .enable = AVR_IO_REGBIT(TIMSK1, OCIE1B),
                                        .raised = AVR_IO_REGBIT(TIFR1, OCF1B),
index ff2c352..da98a43 100644 (file)
@@ -86,10 +86,10 @@ avr_timer_comp(
        uint8_t mode = avr_regbit_get(avr, p->comp[comp].com);
        avr_irq_t * irq = &p->io.irq[TIMER_IRQ_OUT_COMP + comp];
 
-        uint32_t flags = 0;
-        if (p->comp[comp].com_pin.reg) // we got a physical pin
-                flags |= AVR_IOPORT_OUTPUT;
-        AVR_LOG(avr, LOG_TRACE, "Timer comp: irq %p, mode %d @%d\n", irq, mode, when);
+               uint32_t flags = 0;
+               if (p->comp[comp].com_pin.reg)  // we got a physical pin
+                               flags |= AVR_IOPORT_OUTPUT;
+               AVR_LOG(avr, LOG_TRACE, "Timer comp: irq %p, mode %d @%d\n", irq, mode, when);
        switch (mode) {
                case avr_timer_com_normal: // Normal mode OCnA disconnected
                        break;
@@ -127,10 +127,10 @@ avr_timer_comp_on_tov(
        uint8_t mode = avr_regbit_get(avr, p->comp[comp].com);
        avr_irq_t * irq = &p->io.irq[TIMER_IRQ_OUT_COMP + comp];
 
-        // only PWM modes have special behaviour on overflow
-        if((p->wgm_op_mode_kind != avr_timer_wgm_pwm) &&
-           (p->wgm_op_mode_kind != avr_timer_wgm_fast_pwm))
-                return;
+               // only PWM modes have special behaviour on overflow
+               if((p->wgm_op_mode_kind != avr_timer_wgm_pwm) &&
+                  (p->wgm_op_mode_kind != avr_timer_wgm_fast_pwm))
+                               return;
 
        switch (mode) {
                case avr_timer_com_normal: // Normal mode
@@ -970,8 +970,8 @@ avr_timer_init(
 
                if (p->comp[compi].r_ocr) // not all timers have all comparators
                        avr_register_io_write(avr, p->comp[compi].r_ocr, avr_timer_write_ocr, &p->comp[compi]);
-                if (p->comp[compi].foc.reg)
-                        avr_register_io_write(avr, p->comp[compi].foc.reg, avr_timer_write_foc, p);
+                               if (p->comp[compi].foc.reg)
+                                               avr_register_io_write(avr, p->comp[compi].foc.reg, avr_timer_write_foc, p);
        }
        avr_register_io_write(avr, p->r_tcnt, avr_timer_tcnt_write, p);
        avr_register_io_read(avr, p->r_tcnt, avr_timer_tcnt_read, p);