From 7ca1e987764c04b3b5a61f40260d81fcd5fd135e Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 20 Apr 2019 11:17:09 +0200 Subject: [PATCH] Protect SetAdcMuxFor with FPC --- armsrc/fpgaloader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/armsrc/fpgaloader.c b/armsrc/fpgaloader.c index 1be2c6138..f21985c71 100644 --- a/armsrc/fpgaloader.c +++ b/armsrc/fpgaloader.c @@ -468,16 +468,18 @@ void SetAdcMuxFor(uint32_t whichGpio) { LOW(GPIO_MUXSEL_LOPKD); LOW(GPIO_MUXSEL_HIRAW); LOW(GPIO_MUXSEL_LORAW); - + HIGH(whichGpio); #else + if ((whichGpio == GPIO_MUXSEL_LORAW) || (whichGpio == GPIO_MUXSEL_HIRAW)) + return; // FPC serial uses HIRAW/LOWRAW pins, so they are excluded here. AT91C_BASE_PIOA->PIO_OER = GPIO_MUXSEL_HIPKD | GPIO_MUXSEL_LOPKD; AT91C_BASE_PIOA->PIO_PER = GPIO_MUXSEL_HIPKD | GPIO_MUXSEL_LOPKD; LOW(GPIO_MUXSEL_HIPKD); LOW(GPIO_MUXSEL_LOPKD); + HIGH(whichGpio); #endif - HIGH(whichGpio); } void Fpga_print_status(void) {