36 #ifdef PIOS_ENABLE_DEBUG_PINS
38 static uint8_t debug_num_channels;
46 #ifdef PIOS_ENABLE_DEBUG_PINS
51 debug_channels = channels;
52 debug_num_channels = num_channels;
55 for (uint8_t
i = 0;
i < num_channels;
i++) {
59 GPIO_InitTypeDef GPIO_InitStructure;
60 GPIO_StructInit(&GPIO_InitStructure);
61 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
62 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
63 GPIO_InitStructure.GPIO_Pin = chan->init->GPIO_Pin;
66 GPIO_Init(chan->init->port, &GPIO_InitStructure);
69 GPIO_WriteBit(chan->init->port, chan->init->GPIO_Pin, Bit_RESET);
71 #endif // PIOS_ENABLE_DEBUG_PINS
80 #ifdef PIOS_ENABLE_DEBUG_PINS
81 if (!debug_channels || pin >= debug_num_channels) {
87 GPIO_WriteBit(chan->init->port, chan->init->GPIO_Pin, Bit_Set);
89 #endif // PIOS_ENABLE_DEBUG_PINS
98 #ifdef PIOS_ENABLE_DEBUG_PINS
99 if (!debug_channels || pin >= debug_num_channels) {
105 GPIO_WriteBit(chan->init->port, chan->init->GPIO_Pin, Bit_RESET);
107 #endif // PIOS_ENABLE_DEBUG_PINS
113 #ifdef PIOS_ENABLE_DEBUG_PINS
114 if (!debug_channels) {
118 uint32_t bsrr_l = ( ((~value)&0x0F)<<(16+6) ) | ((value & 0x0F)<<6);
119 uint32_t bsrr_h = ( ((~value)&0xF0)<<(16+6-4) ) | ((value & 0xF0)<<(6-4));
127 debug_channels[0].init.port->BSRR = bsrr_l;
128 debug_channels[4].init.port->BSRR = bsrr_h;
131 #endif // PIOS_ENABLE_DEBUG_PINS
136 #ifdef PIOS_ENABLE_DEBUG_PINS
137 if (!debug_channels) {
145 uint32_t bsrr_l = ((~(value & 0x0F)<<(16+6))) | ((value & 0x0F)<<6);
146 debug_channels[0].init.port->BSRR = bsrr_l;
147 #endif // PIOS_ENABLE_DEBUG_PINS
156 #if defined(PIOS_INCLUDE_COM) && defined(PIOS_COM_DEBUG)
157 register int *lr
asm(
"lr");
int32_t PIOS_IRQ_Enable(void)
Main PiOS header to include all the compiled in PiOS options.
int32_t PIOS_COM_SendFormattedStringNonBlocking(uintptr_t com_id, const char *format,...)
void PIOS_DEBUG_PinValue8Bit(uint8_t value)
void PIOS_DEBUG_PinHigh(uint8_t pin)
const char * PIOS_DEBUG_AssertMsg
void PIOS_DEBUG_Init(const struct pios_tim_channel *channels, uint8_t num_channels)
void PIOS_DEBUG_PinLow(uint8_t pin)
int32_t PIOS_IRQ_Disable(void)
void PIOS_DEBUG_PinValue4BitL(uint8_t value)
void PIOS_DEBUG_Panic(const char *msg) __attribute__((noreturn))
#define PIOS_Assert(test)