Own_microsecond_delay busy loop

tinySA-v0.2
erikkaashoek 6 years ago
parent 315b028020
commit 40d5ceac61

@ -2441,6 +2441,17 @@ static DACConfig dac1cfg1 = {
};
#endif
static const GPTConfig gpt4cfg = {
1000000, // 1 MHz timer clock.
NULL, // No callback
0, 0
};
void my_microsecond_delay(int t)
{
gptPolledDelay(&GPTD14, t); // t us delay
}
#if 0
/*
* UART driver configuration structure.
@ -2578,6 +2589,12 @@ int main(void)
*/
ili9341_init();
/*
* Initiate 1 micro second timer
*/
gptStart(&GPTD14, &gpt4cfg);
gptPolledDelay(&GPTD14, 10); // 10 us delay
/* restore config */
config_recall();
if (caldata_recall(0) == -1 || setting.mode == -1) {

@ -104,7 +104,7 @@
#define STM32_GPT_USE_TIM1 FALSE
#define STM32_GPT_USE_TIM2 FALSE
#define STM32_GPT_USE_TIM3 TRUE
#define STM32_GPT_USE_TIM14 FALSE
#define STM32_GPT_USE_TIM14 TRUE
#define STM32_GPT_TIM1_IRQ_PRIORITY 2
#define STM32_GPT_TIM2_IRQ_PRIORITY 2
#define STM32_GPT_TIM3_IRQ_PRIORITY 2

@ -30,7 +30,7 @@
#define __MEASURE__
#define __SELFTEST__
#define __CALIBRATE__
#define __ULTRA__ // Add harmonics mode on low input.
//#define __ULTRA__ // Add harmonics mode on low input.
//#define __ULTRA_SA__ // Adds ADF4351 control for extra high 1st IF stage
#define __SPUR__ // Does spur reduction by shifting IF
@ -121,7 +121,7 @@ enum stimulus_type {
void update_frequencies(void);
void set_sweep_frequency(int type, uint32_t frequency);
uint32_t get_sweep_frequency(int type);
void my_microsecond_delay(int t);
double my_atof(const char *p);
int shell_printf(const char *fmt, ...);

@ -914,7 +914,8 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking)
} else {
modulation_counter++;
}
chThdSleepMicroseconds(200);
my_microsecond_delay(200);
// chThdSleepMicroseconds(200);
} else if (MODE_OUTPUT(setting.mode) && (setting.modulation == MO_NFM || setting.modulation == MO_WFM )) { //FM modulation
SI4432_Sel = 1;
@ -933,6 +934,7 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking)
modulation_counter = 0;
else
modulation_counter++;
my_microsecond_delay(200);
// chThdSleepMicroseconds(200);
}
@ -2068,7 +2070,7 @@ void self_test(int test)
reset_settings(M_LOW);
int i = 15; // calibrate low mode power on 30 MHz;
test_prepare(i);
setting.step_delay = 6000;
setting.step_delay = 8000;
for (int j= 0; j < 57; j++ ) {
setting.step_delay = setting.step_delay * 4/3;
setting.rbw = SI4432_force_RBW(j);
@ -2083,7 +2085,7 @@ void self_test(int test)
}
shell_printf("Start level = %f, ",peakLevel);
while (setting.step_delay > 100 && peakLevel > saved_peakLevel - 1) {
while (setting.step_delay > 10 && peakLevel > saved_peakLevel - 1) {
setting.step_delay = setting.step_delay * 3 / 4;
test_prepare(i);
// shell_printf("\n\rRBW = %f",SI4432_force_RBW(j));

@ -377,7 +377,8 @@ float SI4432_RSSI(uint32_t i, int s)
#endif
//START_PROFILE
SI4432_Sel = s;
chThdSleepMicroseconds(actualStepDelay);
my_microsecond_delay(actualStepDelay);
// chThdSleepMicroseconds(actualStepDelay);
i = setting.repeat;
RSSI_RAW = 0;
while (i-->0)

Loading…
Cancel
Save

Powered by TurnKey Linux.