From 9007d27195ba552a49cb32b369e963b38d5657f6 Mon Sep 17 00:00:00 2001 From: fishpepper Date: Sat, 3 Sep 2016 20:54:52 +0200 Subject: [PATCH] fixed code for usky --- OpenSky.files | 4 ++++ arch/cc251x/hal_adc.c | 4 ++-- board/usky/config.h | 8 ++++---- frsky.c | 4 +++- main.h | 1 + telemetry.c | 4 +++- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/OpenSky.files b/OpenSky.files index 3f8d1cd..8a5372e 100644 --- a/OpenSky.files +++ b/OpenSky.files @@ -291,3 +291,7 @@ board/vd5m/hal_clocksource.c board/vd5m/hal_clocksource.h board/vd5m/hal_uart.c board/vd5m/hal_uart.h +arch/cc251x/hal_adc.c +arch/cc251x/hal_adc.h +arch/cc251x/hal_soft_serial.c +arch/cc251x/hal_soft_serial.h diff --git a/arch/cc251x/hal_adc.c b/arch/cc251x/hal_adc.c index 9288528..3ec6698 100644 --- a/arch/cc251x/hal_adc.c +++ b/arch/cc251x/hal_adc.c @@ -49,8 +49,8 @@ void hal_adc_init(void) { ADCCON1 = ADCCON1_ST | ADCCON1_STSEL_FULL_SPEED | 0b11; //configure DMA1 + DMA2: - hal_adc_dma_init(1, &hal_adc_data[0], DMA_TRIG_ADC_CH5); - hal_adc_dma_init(2, &hal_adc_data[1], DMA_TRIG_ADC_CH6); + hal_adc_dma_init(1, &hal_adc_data[0], DMA_TRIG_ADC_CH0 + ADC0); + hal_adc_dma_init(2, &hal_adc_data[1], DMA_TRIG_ADC_CH0 + ADC1); //set pointer to the DMA configuration struct into DMA-channel 1-4 //configuration diff --git a/board/usky/config.h b/board/usky/config.h index 0c3345f..f654ad9 100644 --- a/board/usky/config.h +++ b/board/usky/config.h @@ -8,8 +8,8 @@ //note: change of adc ch require change in adc.c! #define ADC_PORT P0 -#define ADC0 5 -#define ADC1 6 +#define ADC0 5 //ADC0 is actually Pin 6, but we use this for telemetry on uSKY -> hack to disable it +#define ADC1 5 //acs712 in inverted mode on adc1? //when powered by 5V we can use a trick //to get a good resolution: use inverted power inputs @@ -42,8 +42,8 @@ //hub telemetry input (will run a soft serial port) #define SOFT_SERIAL_PORT P0 -#define SOFT_SERIAL_PIN 7 +#define SOFT_SERIAL_PIN 6 -#define DEFAULT_FSCAL_VALUE -20 +#define DEFAULT_FSCAL_VALUE -69 diff --git a/frsky.c b/frsky.c index 21f6cc7..0370076 100644 --- a/frsky.c +++ b/frsky.c @@ -632,7 +632,9 @@ void frsky_calib_pll(void){ //return to idle cc25xx_strobe(RFST_SIDLE); - debug("frsky: calib fscal1 = "); + debug("frsky: calib fscal0 = "); + debug_put_int8(storage.frsky_freq_offset); + debug("\nfrsky: calib fscal1 = "); for(i=0; i