Skip to content

Commit

Permalink
fixed code for usky
Browse files Browse the repository at this point in the history
  • Loading branch information
fishpepper committed Sep 3, 2016
1 parent 5eeb4d2 commit 9007d27
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions OpenSky.files
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions arch/cc251x/hal_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions board/usky/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

4 changes: 3 additions & 1 deletion frsky.c
Original file line number Diff line number Diff line change
Expand Up @@ -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<FRSKY_HOPTABLE_SIZE; i++){
debug_put_hex8(frsky_calib_fscal1_table[i]);
debug_putc(' ');
Expand Down
1 change: 1 addition & 0 deletions main.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

//useful for debugging. DO NOT USE!
#define ADC_DO_TEST 0
#define TELEMETRY_DO_TEST 0


#define min(a,b) (((a)<(b))?(a):(b))
Expand Down
4 changes: 3 additions & 1 deletion telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ void telemetry_init(void) {
// attach callback
soft_serial_set_rx_callback(&telemetry_rx_callback);

//telemetry_rx_echo_test();
#if TELEMETRY_DO_TEST
telemetry_rx_echo_test();
#endif
}


Expand Down

0 comments on commit 9007d27

Please sign in to comment.