/*-----------------------------------------------------------*/ /* * The interrupt service routine used depends on whether the pre-emptive * scheduler is being used or not. */ #if configUSE_PREEMPTION == 1 /* * Tick ISR for preemptive scheduler. We can use a naked attribute as * the context is saved at the start of vPortYieldFromTick(). The tick * count is incremented after the context is saved. */ __attribute__ (( __interrupt__ (TIMER0_A0_VECTOR), naked )) void prvTickISR( void ) { /* Save the context of the interrupted task. */ portSAVE_CONTEXT(); /* Increment the tick count then switch to the highest priority task that is ready to run. */ if( xTaskIncrementTick() != pdFALSE ) { vTaskSwitchContext(); } /* Restore the context of the new task. */ portRESTORE_CONTEXT(); }
TACCR0 = SIDEREAL_RATE; } else { driverPointer -= 1; TACCR0 = 300; } driverPointer = driverPointer & ((sizeof DRIVER_TABLE / sizeof *DRIVER_TABLE)-1); setDriver(DRIVER_TABLE[driverPointer]); } } /* The TimerA ISRs need to be written in assembler because gcc is too brain damaged to do the obvious thing when presented with something like A += B (and it also insists on pushing a ton of registers on the stack for no reason whatsoever). */ __attribute__ ((__naked__,__interrupt__(TIMERA0_VECTOR))) static void timerA0_isr(void) { __bic_status_register_on_exit(CPUOFF); asm("reti"); } __attribute__ ((__naked__)) static void TACCR1_isr(void) { asm("reti"); } __attribute__ ((__naked__)) static void TACCR2_isr(void) { asm("reti"); // do nothing -- TA2 devices can't get here }
global_data_A36582.imag_internal_adc.reading_scaled_and_calibrated, global_data_A36582.arc_this_pulse ); } } void ResetPulseLatches(void) { PIN_PULSE_LATCH_RESET = OLL_RESET_LATCHES; __delay32(20); PIN_PULSE_LATCH_RESET = !OLL_RESET_LATCHES; } void __attribute__((__interrupt__(__preprologue__("BCLR ADCON1, #1")), no_auto_psv)) _INT1Interrupt(void) { /* A sample trigger has been received */ // DPARKER these functions may mess with the timing global_data_A36582.sample_energy_mode = ETMCanSlaveGetPulseLevel(); global_data_A36582.sample_index = ETMCanSlaveGetPulseCount(); global_data_A36582.sample_complete = 1; // Check that there was enough time between pulses // if ((TMR2 <= MINIMUM_PULSE_PERIOD_T2) && (_T2IF == 0)) { global_data_A36582.minimum_pulse_period_fault_count++; } _T2IF = 0;