Skip to content
Snippets Groups Projects
Commit ca333d8c authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Binary data for LSV

parent a9da6bc6
Branches
Tags
No related merge requests found
......@@ -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());
}
......
No preview for this file type
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment