diff --git a/DSTAT-temp/src/experiment.c b/DSTAT-temp/src/experiment.c index c65dd9bce62aa5284366996f4377d271fbf4ae04..caeef4091ddcc54d966bea275d736e6ac4ae28d0 100644 --- a/DSTAT-temp/src/experiment.c +++ b/DSTAT-temp/src/experiment.c @@ -393,44 +393,16 @@ static void porte_int0_lsv(void){ /** * ISR for taking LSV measurements. */ - int32_t result; -// -// if (autogain_enable == 0){ -// // while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5))); -// result=ads1255_read_fast24(); -// goto noauto; -// } -// -// else{ -// while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5))); -// result=ads1255_read(); -// } -// -// if (autogainswitch()==0){ -// noauto: -// // if (g_gain == POT_GAIN_300) -// // printf("%u %ld\n\r", TCC1.CNT,result); -// // else if (g_gain == POT_GAIN_3k) -// // printf("%u %ld\n\r", TCC1.CNT, result); -// // else if (g_gain == POT_GAIN_30k) -// // printf("%u %ld000\n\r", TCC1.CNT, result); -// // else if (g_gain == POT_GAIN_300k) -// // printf("%u %ld00\n\r", TCC1.CNT, result); -// // else if (g_gain == POT_GAIN_3M) -// // printf("%u %ld0\n\r", TCC1.CNT, result); -// // else if (g_gain == POT_GAIN_30M) -// // printf("%u %ld\n\r", TCC1.CNT, result); -// // else -// printf("%u %ld\n\r", TCC1.CNT, result); -// } -// -// return; + int32_t result = ads1255_read_fast24(); + static uint16_t last_value = 0; uint32_t current = TCC1.CNT; - - result = ads1255_read_fast24(); - printf("%lu %ld\n\r", (current+last_value)>>1, result); //DAC value is average of current and last timer - approximation of center of averaging window + printf("B\n"); + send_data_uint16((current+last_value)>>1); + send_data_int32(result); +// printf("%lu %ld\n\r", (current+last_value)>>1, result); //DAC value is average of current and last timer - approximation of center of averaging window last_value = (uint16_t)current; + printf("\n"); return; } @@ -510,10 +482,11 @@ void ca_experiment(uint16_t steps, uint16_t step_dac[], uint16_t step_seconds[]) } static void portd_int0_ca(void){ + int32_t data = ads1255_read_fast24(); printf("B\n"); send_data_uint16(TCC0.CNT); send_data_uint16(RTC.CNT); - send_data_int32(ads1255_read_fast24()); + send_data_int32(data); printf("\n"); // printf("%u.%.3u %ld\n\r", TCC0.CNT, RTC.CNT, ads1255_read_fast24()); } diff --git a/DSTAT1.atsuo b/DSTAT1.atsuo index 6802fea10785f1825308195d3856bdefc373a8f5..e7185ef389aa30a249f496141a96d58cc3d07d0d 100644 Binary files a/DSTAT1.atsuo and b/DSTAT1.atsuo differ