fundamental improvemements of this awsome utility

This commit is contained in:
Antoine Drouin
2010-07-26 21:13:22 +00:00
parent 00b13ef4fc
commit 1a1e24cc2e
+32 -12
View File
@@ -4,6 +4,31 @@
/* using servo 2 connector as debug */
#define DEBUG_S1_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_6; }
#define DEBUG_S1_ON() { GPIOC->BSRR = GPIO_Pin_6; }
#define DEBUG_S1_OFF() { GPIOC->BRR = GPIO_Pin_6; }
#define DEBUG_S2_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_7; }
#define DEBUG_S2_ON() { GPIOC->BSRR = GPIO_Pin_7; }
#define DEBUG_S2_OFF() { GPIOC->BRR = GPIO_Pin_7; }
#define DEBUG_S3_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_8; }
#define DEBUG_S3_ON() { GPIOC->BSRR = GPIO_Pin_8; }
#define DEBUG_S3_OFF() { GPIOC->BRR = GPIO_Pin_8; }
#define DEBUG_S4_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_9; }
#define DEBUG_S4_ON() { GPIOC->BSRR = GPIO_Pin_9; }
#define DEBUG_S4_OFF() { GPIOC->BRR = GPIO_Pin_9; }
#define DEBUG_S5_TOGGLE() { GPIOB->ODR ^= GPIO_Pin_8; }
#define DEBUG_S5_ON() { GPIOB->BSRR = GPIO_Pin_8; }
#define DEBUG_S5_OFF() { GPIOB->BRR = GPIO_Pin_8; }
#define DEBUG_S6_TOGGLE() { GPIOB->ODR ^= GPIO_Pin_9; }
#define DEBUG_S6_ON() { GPIOB->BSRR = GPIO_Pin_9; }
#define DEBUG_S6_OFF() { GPIOB->BRR = GPIO_Pin_9; }
#define DEBUG_SERVO1_INIT() { \
/* S1: PC6 S2: PC7 S3: PC8 */ \
@@ -14,7 +39,10 @@
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; \
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; \
GPIO_Init(GPIOC, &GPIO_InitStructure); \
}
DEBUG_S1_OFF(); \
DEBUG_S2_OFF(); \
DEBUG_S3_OFF(); \
}
#define DEBUG_SERVO2_INIT() { \
/* S4: PC9 */ \
@@ -32,18 +60,10 @@
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; \
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; \
GPIO_Init(GPIOB, &GPIO_InitStructure); \
DEBUG_S4_OFF(); \
DEBUG_S5_OFF(); \
DEBUG_S6_OFF(); \
}
#define DEBUG_S1_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_6; }
#define DEBUG_S2_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_7; }
#define DEBUG_S3_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_8; }
#define DEBUG_S4_TOGGLE() { GPIOC->ODR ^= GPIO_Pin_9; }
#define DEBUG_S5_TOGGLE() { GPIOB->ODR ^= GPIO_Pin_8; }
#define DEBUG_S6_TOGGLE() { GPIOB->ODR ^= GPIO_Pin_9; }
#endif /* MY_DEBUG_SERVO_H */