diff --git a/DSTAT/src/experiment.c b/DSTAT/src/experiment.c index 5996432507244af007bc075a68283f2d9c4ce6f9..8a92928e75e05162f397b8493c5dbdf3940ecb3a 100644 --- a/DSTAT/src/experiment.c +++ b/DSTAT/src/experiment.c @@ -483,42 +483,12 @@ uint8_t lsv_experiment(int16_t start, int16_t stop, uint16_t slope, int8_t first printf("ERR: Frequency/ADC rate is too low\n\r"); return ret; } - - //printf("Period:%lu\n\r", timer_period); + ads1255_wakeup(); tc_write_period(&TCC1, 0xffff); tc_write_period(&TCC0, (uint16_t)timer_period); -// //DMA -// struct dma_channel_config dmach_conf; -// memset(&dmach_conf, 0, sizeof(dmach_conf)); -// -// dma_channel_set_burst_length(&dmach_conf, DMA_CH_BURSTLEN_1BYTE_gc); -// dma_channel_set_transfer_count(&dmach_conf, 1); -// -// dma_channel_set_src_reload_mode(&dmach_conf, DMA_CH_SRCRELOAD_TRANSACTION_gc); -// dma_channel_set_dest_reload_mode(&dmach_conf, DMA_CH_DESTRELOAD_NONE_gc); -// -// dma_channel_set_src_dir_mode(&dmach_conf, DMA_CH_SRCDIR_FIXED_gc); -// dma_channel_set_source_address(&dmach_conf, (uint16_t)(uintptr_t)&TCC1.CNTH); -// -// dma_channel_set_dest_dir_mode(&dmach_conf, DMA_CH_DESTDIR_FIXED_gc); -// dma_channel_set_destination_address(&dmach_conf, (uint16_t)(uintptr_t)&USARTC1.DATA); -// -// dma_channel_set_trigger_source(&dmach_conf, DMA_CH_TRIGSRC_OFF_gc); -// dma_channel_set_single_shot(&dmach_conf); -// -// dma_set_callback(0, (dma_callback_t)lsv_dma_callback); -// dma_channel_set_interrupt_level(&dmach_conf, DMA_INT_LVL_HI); -// -// dma_channel_write_config(0, &dmach_conf); -// -// dma_set_callback(1, (dma_callback_t)lsv_dma_callback1); -// dma_channel_set_source_address(&dmach_conf, (uint16_t)(uintptr_t)&TCC1.CNTL); -// dma_channel_write_config(1, &dmach_conf); } -// -// dma_channel_enable(0); TCC1.CNT = dacindex_start; diff --git a/DSTAT/src/main.c b/DSTAT/src/main.c index 5c3e6991dabd6f99a4c94a47a7fe1e1930ac3595..2c742106d66cdf7ca0bd384c6af6b7ab65df9a42 100644 --- a/DSTAT/src/main.c +++ b/DSTAT/src/main.c @@ -37,8 +37,7 @@ int8_t command_handler(char command){ ads1255_setup(o1, o2, o3); break; - case 'G': //Gain - start gain, autogain on/off, (min gain, max gain), low/high switch thresholds - //scanf("%1u%1u%7li%7li",&g_gain,&autogain_enable,&overcurrent_threshold,&undercurrent_threshold); + case 'G': //Gain scanf("%u",&g_gain); printf("#G: %u\r\n", g_gain); pot_set_gain(); //uses global g_gain, so no params diff --git a/DSTAT/src/max5443.c b/DSTAT/src/max5443.c index b7e2ea61bffcc3ae3168443a18999af9e2983b79..fd73c0474d2f22fe76451b707799f1d2e4a12303 100644 --- a/DSTAT/src/max5443.c +++ b/DSTAT/src/max5443.c @@ -55,8 +55,6 @@ void max5443_set_voltage1(uint16_t dacindex){ uint16_t ui16; } buffer; -// if (buffer.ui16 == dacindex) -// return; if (max5443_offset < 0) { max5443_offset = abs(max5443_offset); @@ -70,14 +68,6 @@ void max5443_set_voltage1(uint16_t dacindex){ else buffer.ui16 = dacindex + (uint16_t)max5443_offset; - -// if (65535-dacindex < max5443_offset) -// buffer.ui16 = 65535; -// else if (dacindex < (uint16_t)(-1*max5443_offset)) -// buffer.ui16 = 0; -// else -// buffer.ui16 = dacindex+max5443_offset; - irqflags_t flags; flags = cpu_irq_save(); @@ -90,22 +80,3 @@ void max5443_set_voltage1(uint16_t dacindex){ return; } - -// void max5443_set_voltage_8bit(uint8_t dacindex){ -// spi_select_device(&SPIC, &spi_device_conf_c); -// spi_write_single(&SPIC, dacindex); -// spi_deselect_device(&SPIC, &spi_device_conf_c); -// return; -// } - -/*void max5443_set_voltage(uint8_t msb, uint8_t lsb){ - irqflags_t flags; - flags = cpu_irq_save(); - - spi_select_device(&SPIC, &spi_device_conf_c); - spi_write_single(&SPIC, msb); - spi_write_single(&SPIC, lsb); - spi_deselect_device(&SPIC, &spi_device_conf_c); - - cpu_irq_restore(flags); -}*/ \ No newline at end of file