diff --git a/main.c b/main.c index 9e2f023..f89b33e 100644 --- a/main.c +++ b/main.c @@ -90,20 +90,6 @@ const float gVoltageScale[VOLTAGE_SCALES] = { 0.1, 0.2, 0.5, 1., 2. }; -#define TIME_SCALES 6 -const char * const gTimeScaleStr[TIME_SCALES] = { -"100 ms", "50 ms", "20 ms", " 10 ms", "50 us", "20 us" -}; - -const uint64_t gTImeScale[TIME_SCALES] = { - 100 * 1000 / PIXELS_PER_DIV, - 50 * 1000 / PIXELS_PER_DIV, - 20 * 1000 / PIXELS_PER_DIV, - 10 * 1000 / PIXELS_PER_DIV, - 50 / PIXELS_PER_DIV, - 20 / PIXELS_PER_DIV, -}; - int Trigger(bool rising); // start a pwm test signal @@ -283,14 +269,6 @@ void handle_user_input() { case Down: // previous scale local_options.voltage_scale = (local_options.voltage_scale + VOLTAGE_SCALES - 1) % VOLTAGE_SCALES; break; - case Right: // next scale - local_options.time_scale = (local_options.time_scale + 1) % TIME_SCALES; - set_frequency(gTImeScale[local_options.time_scale]); - break; - case Left: // previous scale - local_options.time_scale = (local_options.time_scale + TIME_SCALES - 1) % TIME_SCALES; - set_frequency(gTImeScale[local_options.time_scale]); - break; } Semaphore_pend(options_sem, BIOS_WAIT_FOREVER); @@ -336,7 +314,6 @@ void display_waveform(UArg arg1, UArg arg2) // info GrContextForegroundSet(&sContext, ClrWheat); GrStringDraw(&sContext, gVoltageScaleStr[local_options.voltage_scale], /*length*/ -1, /*x*/ 0, /*y*/ 0, /*opaque*/ false); - GrStringDraw(&sContext, gTimeScaleStr[local_options.time_scale], /*length*/ -1, /*x*/ 60, /*y*/ 0, /*opaque*/ false); snprintf(str, sizeof(str), "CPU Load %.1f%%", usage_percent); GrStringDraw(&sContext, str, /*length*/ -1, /*x*/ 0, /*y*/ HEIGHT - 10, /*opaque*/ false); diff --git a/sampling.c b/sampling.c index 51fca2c..1f32b1e 100644 --- a/sampling.c +++ b/sampling.c @@ -119,8 +119,6 @@ void start_sampler() { SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1); - // timer for low-speed - SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2); // ADC clock uint32_t pll_frequency = SysCtlFrequencyGet(CRYSTAL_FREQUENCY); uint32_t pll_divisor = @@ -145,25 +143,3 @@ void start_sampler() { ADCSequenceDMAEnable(ADC1_BASE, 0); // enable DMA for ADC1 sequence 0 ADCIntEnableEx(ADC1_BASE, ADC_INT_DMA_SS0); // enable ADC1 sequence 0 DMA interrupt } - -void set_frequency(uint64_t microseconds) { - if (microseconds == 1) { - ADCSequenceDisable(ADC1_BASE, 0); - // don't use a timer for high speed - ADCSequenceConfigure(ADC1_BASE, 0, ADC_TRIGGER_ALWAYS, 0); - ADCSequenceEnable(ADC1_BASE, 0); - return; - } - - // initialize timer 2 in periodic mode - TimerDisable(TIMER2_BASE, TIMER_BOTH); - TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC); - #define MICROSECONDS_PER_SECOND 1000000 - TimerLoadSet(TIMER2_BASE, TIMER_A, (uint32_t) ((uint64_t) gSystemClock * microseconds / MICROSECONDS_PER_SECOND) - 1); - TimerControlTrigger(TIMER2_BASE, TIMER_A, true); - TimerEnable(TIMER2_BASE, TIMER_A); - - ADCSequenceDisable(ADC1_BASE, 0); - ADCSequenceConfigure(ADC1_BASE, 0, ADC_TRIGGER_TIMER, 0); - ADCSequenceEnable(ADC1_BASE, 0); -} diff --git a/src/sysbios/sysbios.aem4f b/src/sysbios/sysbios.aem4f index 793a174..fe551a3 100644 Binary files a/src/sysbios/sysbios.aem4f and b/src/sysbios/sysbios.aem4f differ