mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-08-21 14:36:21 +02:00
Handle the M17 mode LED pins(-ish)
This commit is contained in:
@@ -106,6 +106,14 @@ void CIO::initInt()
|
||||
GPIO_Init(PORT_NXDN, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_M17_LEDS)
|
||||
// M17 pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_M17, ENABLE);
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_M17;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_Init(PORT_M17, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||
// POCSAG pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_POCSAG, ENABLE);
|
||||
@@ -157,6 +165,14 @@ void CIO::initInt()
|
||||
GPIO_Init(PORT_MNXDN, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_M17_LEDS)
|
||||
// M17 mode pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_MM17, ENABLE);
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_MM17;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_Init(PORT_MM17, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||
// POCSAG mode pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_MPOCSAG, ENABLE);
|
||||
@@ -441,6 +457,27 @@ void CIO::setNXDNInt(bool on)
|
||||
#endif
|
||||
}
|
||||
|
||||
void CIO::setM17Int(bool on)
|
||||
{
|
||||
#if defined(MODE_LEDS)
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
GPIO_WriteBit(PORT_DSTAR, PIN_DSTAR, on ? Bit_SET : Bit_RESET);
|
||||
GPIO_WriteBit(PORT_P25, PIN_P25, on ? Bit_SET : Bit_RESET);
|
||||
#else
|
||||
GPIO_WriteBit(PORT_M17, PIN_M17, on ? Bit_SET : Bit_RESET);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MODE_PINS) && defined(STM32F4_NUCLEO_MORPHO_HEADER) && (defined(STM32F4_NUCLEO) || defined(STM32F722_RPT_HAT))
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
GPIO_WriteBit(PORT_MDSTAR, PIN_MDSTAR, on ? Bit_SET : Bit_RESET);
|
||||
GPIO_WriteBit(PORT_MP25, PIN_MP25, on ? Bit_SET : Bit_RESET);
|
||||
#else
|
||||
GPIO_WriteBit(PORT_MM17, PIN_MM17, on ? Bit_SET : Bit_RESET);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void CIO::setPOCSAGInt(bool on)
|
||||
{
|
||||
#if defined(MODE_LEDS)
|
||||
|
||||
Reference in New Issue
Block a user