[Taranis X9E] Fixes (frequencies on M4, pots calibration, soft power

delay after startup)
This commit is contained in:
bsongis
2015-03-03 20:14:23 +01:00
parent fffa39a286
commit 4c0515ab91
9 changed files with 56 additions and 37 deletions
+12
View File
@@ -163,6 +163,7 @@ void adcRead()
DMA2->LIFCR = DMA_LIFCR_CTCIF0 | DMA_LIFCR_CHTIF0 |DMA_LIFCR_CTEIF0 | DMA_LIFCR_CDMEIF0 | DMA_LIFCR_CFEIF0 ; // Write ones to clear bits
DMA2_Stream0->CR |= DMA_SxCR_EN ; // Enable DMA
ADC1->CR2 |= (uint32_t)ADC_CR2_SWSTART ;
#if defined(REV9E)
DMA2_Stream1->CR &= ~DMA_SxCR_EN ; // Disable DMA
ADC3->SR &= ~(uint32_t) ( ADC_SR_EOC | ADC_SR_STRT | ADC_SR_OVR ) ;
@@ -170,12 +171,23 @@ void adcRead()
DMA2_Stream1->CR |= DMA_SxCR_EN ; // Enable DMA
ADC3->CR2 |= (uint32_t)ADC_CR2_SWSTART ;
#endif // #if defined(REV9E)
#if defined(REV9E)
for (unsigned int i=0; i<10000; i++) {
if ((DMA2->LISR & DMA_LISR_TCIF0) && (DMA2->LISR & DMA_LISR_TCIF1)) {
break;
}
}
DMA2_Stream0->CR &= ~DMA_SxCR_EN ; // Disable DMA
DMA2_Stream1->CR &= ~DMA_SxCR_EN ; // Disable DMA
#else
for (unsigned int i=0; i<10000; i++) {
if (DMA2->LISR & DMA_LISR_TCIF0) {
break;
}
}
DMA2_Stream0->CR &= ~DMA_SxCR_EN ; // Disable DMA
#endif
#if !defined(REV3)
// adc direction correct
+8 -5
View File
@@ -94,14 +94,17 @@ extern "C" {
#define BOOTLOADER_SIZE 0x8000
#define FIRMWARE_ADDRESS 0x08000000
#define PERI1_FREQUENCY 30000000
#define PERI2_FREQUENCY 60000000
#if defined(REV9E)
#define PERI1_FREQUENCY 42000000
#define PERI2_FREQUENCY 84000000
#else
#define PERI1_FREQUENCY 30000000
#define PERI2_FREQUENCY 60000000
#endif
#define TIMER_MULT_APB1 2
#define TIMER_MULT_APB2 2
// #define JACK_PPM_OUT()
// #define JACK_PPM_IN()
#define PIN_MODE_MASK 0x0003
#define PIN_INPUT 0x0000
#define PIN_OUTPUT 0x0001