mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 06:54:49 +08:00
fixed vor
This commit is contained in:
@@ -4,13 +4,12 @@
|
||||
|
||||
ARCH=lpc21
|
||||
|
||||
VOR=vor
|
||||
|
||||
FLASH_MODE = IAP
|
||||
main.ARCHDIR = $(ARCH)
|
||||
|
||||
main.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\"
|
||||
main.srcs = $(VOR)/lpc_vor_main.c
|
||||
main.CFLAGS += -DBOARD_CONFIG=\"boards/olimex_lpc_h2148.h\"
|
||||
main.srcs = firmwares/vor/lpc_vor_main.c
|
||||
|
||||
main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./29880.)'
|
||||
main.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c
|
||||
@@ -19,7 +18,7 @@ main.CFLAGS += -DLED
|
||||
|
||||
main.srcs += $(SRC_ARCH)/armVIC.c
|
||||
|
||||
main.srcs += $(VOR)/lpc_vor_convertions.c
|
||||
main.srcs += firmwares/vor/lpc_vor_convertions.c
|
||||
|
||||
main.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B9600
|
||||
main.srcs += $(SRC_ARCH)/uart_hw.c
|
||||
@@ -27,7 +26,7 @@ main.srcs += $(SRC_ARCH)/uart_hw.c
|
||||
main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0
|
||||
main.srcs += downlink.c pprz_transport.c
|
||||
|
||||
main.srcs += $(VOR)/vor_int_demod_decim.c
|
||||
main.srcs += firmwares/vor/vor_int_demod_decim.c
|
||||
|
||||
|
||||
</makefile>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef CONFIG_DEMO_H
|
||||
#define CONFIG_DEMO_H
|
||||
|
||||
/* Master oscillator freq. */
|
||||
#define FOSC (12000000)
|
||||
/* PLL multiplier */
|
||||
#define PLL_MUL (5)
|
||||
/* CPU clock freq. */
|
||||
#define CCLK (FOSC * PLL_MUL)
|
||||
/* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */
|
||||
#define PBSD_BITS 0x00
|
||||
#define PBSD_VAL 4
|
||||
/* Peripheral bus clock freq. */
|
||||
#define PCLK (CCLK / PBSD_VAL)
|
||||
|
||||
#define LED_1_BANK 1
|
||||
#define LED_1_PIN 24
|
||||
|
||||
|
||||
#endif /* CONFIG_DEMO_H */
|
||||
@@ -16,5 +16,7 @@
|
||||
#define LED_1_BANK 1
|
||||
#define LED_1_PIN 24
|
||||
|
||||
#define LED_2_BANK 1
|
||||
#define LED_2_PIN 23
|
||||
|
||||
#endif /* CONFIG_OLIMEX_H2148_H */
|
||||
|
||||
@@ -55,7 +55,7 @@ void vor_adc_init( void ) {
|
||||
/* clear match */
|
||||
T0EMR &= ~TEMR_EM1;
|
||||
/* set high on match 1 */
|
||||
T0EMR |= TEMR_EMC11;
|
||||
T0EMR |= (3<<6);//TEMR_EMC1_1;
|
||||
/* first match in a while */
|
||||
T0MR1 = 1024;
|
||||
vor_adc_overrun = FALSE;
|
||||
@@ -64,6 +64,9 @@ void vor_adc_init( void ) {
|
||||
|
||||
void adcISR0 ( void ) {
|
||||
ISR_ENTRY();
|
||||
|
||||
LED_TOGGLE(2);
|
||||
|
||||
uint32_t tmp = AD0GDR;
|
||||
// uint32_t tmp = AD0DR3;
|
||||
// uint8_t channel = (uint8_t)(tmp >> 24) & 0x07;
|
||||
|
||||
@@ -17,23 +17,24 @@ static inline void main_report( void );
|
||||
|
||||
int main( void ) {
|
||||
main_init();
|
||||
|
||||
while(1) {
|
||||
if (vor_adc_sample_available) {
|
||||
int16_t off_sample = vor_adc_sample - 512;
|
||||
// off_sample *= 2;
|
||||
|
||||
|
||||
vor_int_demod_run (off_sample);
|
||||
|
||||
|
||||
if (vid_qdr_available) {
|
||||
vid_qdr_available = FALSE;
|
||||
main_report();
|
||||
}
|
||||
|
||||
|
||||
VorDacSet(vor_adc_sample);
|
||||
vor_adc_sample_available = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user