mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
2 new PIOS_DEBUG functions to output a value on the debug-pins. In its current implementation it will probably not work on CC....
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2971 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
5f52ef6aaa
commit
35475820ad
@ -100,6 +100,28 @@ void PIOS_DEBUG_PinLow(uint8_t Pin)
|
||||
#endif // PIOS_ENABLE_DEBUG_PINS
|
||||
}
|
||||
|
||||
|
||||
void PIOS_DEBUG_PinValue8Bit(uint8_t value)
|
||||
{
|
||||
#ifdef PIOS_ENABLE_DEBUG_PINS
|
||||
uint32_t bsrr_l = ((~(value & 0x0F)<<(16+6))) | ((value & 0x0F)<<6);
|
||||
uint32_t bsrr_h = ((~(value & 0xF0)<<(16+6-4))) | ((value & 0xF0)<<(6-4));
|
||||
PIOS_IRQ_Disable();
|
||||
PIOS_SERVO_GPIO_PORT_1TO4->BSRR = bsrr_l;
|
||||
PIOS_SERVO_GPIO_PORT_5TO8->BSRR = bsrr_h;
|
||||
PIOS_IRQ_Enable();
|
||||
#endif // PIOS_ENABLE_DEBUG_PINS
|
||||
}
|
||||
|
||||
void PIOS_DEBUG_PinValue4BitL(uint8_t value)
|
||||
{
|
||||
#ifdef PIOS_ENABLE_DEBUG_PINS
|
||||
uint32_t bsrr_l = ((~(value & 0x0F)<<(16+6))) | ((value & 0x0F)<<6);
|
||||
PIOS_SERVO_GPIO_PORT_1TO4->BSRR = bsrr_l;
|
||||
#endif // PIOS_ENABLE_DEBUG_PINS
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Report a serious error and halt
|
||||
*/
|
||||
|
@ -36,6 +36,8 @@ extern const char *PIOS_DEBUG_AssertMsg;
|
||||
void PIOS_DEBUG_Init(void);
|
||||
void PIOS_DEBUG_PinHigh(uint8_t pin);
|
||||
void PIOS_DEBUG_PinLow(uint8_t pin);
|
||||
void PIOS_DEBUG_PinValue8Bit(uint8_t value);
|
||||
void PIOS_DEBUG_PinValue4BitL(uint8_t value);
|
||||
void PIOS_DEBUG_Panic(const char *msg);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user