fork download
  1. void __ISR(_TIMER_1_VECTOR, ipl3) _Timer1Handler(void)
  2. {
  3.  
  4. ADC_SPI_ON();
  5. SPI1BUF = GYRO_PPO2;
  6. while (!SPI1STATbits.SPIRBF);
  7. dummy_int = SPI1BUF;
  8. SPI1BUF = 0xFF;
  9. while (!SPI1STATbits.SPIRBF);
  10. adc_data[adc_data_index] = SPI1BUF;
  11. SPI1BUF = 0xFF;
  12. while (!SPI1STATbits.SPIRBF);
  13. adc_data[adc_data_index+1] = SPI1BUF;
  14. ADC_SPI_OFF();
  15. //Nop(); Nop();
  16.  
  17. adc_data_index += 2;
  18. adc_samples++;
  19.  
  20.  
  21. if(((adc_data_index & (ADC_CHUNK_SIZE-1)) == 0) && adc_data_index > 0){
  22. system_crash = 1; //assume the buffer is overflowing
  23. int i = 0;
  24. for(i; i<N_CHUNKS_IN_BUFFER; i++){
  25.  
  26. if(adc_data_index_fifo[i] == -1){
  27.  
  28. adc_data_index_fifo[i] = adc_data_index - ADC_CHUNK_SIZE;
  29. system_crash = 0; //great - no overflow after all
  30. //LED1 = 1;
  31. break;
  32. }
  33.  
  34. }
  35.  
  36. }
  37.  
  38. if(adc_data_index == ADC_BUF_SIZE) adc_data_index = 0;
  39.  
  40. mT1ClearIntFlag(); // clear the interrupt flag
  41.  
  42. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function '__ISR':
prog.c:1:35: error: expected declaration specifiers before '_Timer1Handler'
 void __ISR(_TIMER_1_VECTOR, ipl3) _Timer1Handler(void)
                                   ^
prog.c:1:6: warning: type of '_TIMER_1_VECTOR' defaults to 'int' [-Wimplicit-int]
 void __ISR(_TIMER_1_VECTOR, ipl3) _Timer1Handler(void)
      ^
prog.c:1:6: warning: type of 'ipl3' defaults to 'int' [-Wimplicit-int]
prog.c:42:2: error: expected '{' at end of input
  }
  ^
stdout
Standard output is empty