From 03188cd333d38f396cb304c42d610a9ea7e720f3 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 3 Oct 2021 14:51:46 +0200 Subject: [PATCH] [t18/tx18s] add some delay after turning the internal module on This allows to avoid power supply instabilities. Resolves #802 --- radio/src/targets/horus/board.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/horus/board.h b/radio/src/targets/horus/board.h index c41ff0fc9..ca8839f80 100644 --- a/radio/src/targets/horus/board.h +++ b/radio/src/targets/horus/board.h @@ -146,7 +146,26 @@ uint32_t isBootloaderStart(const uint8_t * buffer); void SDRAM_Init(); // Pulses driver -#define INTERNAL_MODULE_ON() GPIO_SetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN) +#if defined(RADIO_T18) + +// TX18S Workaround (see https://github.com/EdgeTX/edgetx/issues/802): +// Add some delay after turning the internal module ON +// on the T18 / TX18S, as the latter seems to have issues +// with power supply showing instability +// +#define INTERNAL_MODULE_ON() \ + do { \ + GPIO_SetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN); \ + delay_ms(1); \ + } while (0) + +#else + +// Just turn the modue ON for all other targets +#define INTERNAL_MODULE_ON() \ + GPIO_SetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN) + +#endif #if defined(INTERNAL_MODULE_PXX1) || defined(INTERNAL_MODULE_PXX2) #define HARDWARE_INTERNAL_RAS