mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-02-28 11:54:30 +03:00
fixed bug with LEDs
This commit is contained in:
@@ -27,28 +27,23 @@
|
||||
#define FORMUSART(X) CONCAT(USART, X)
|
||||
#define USARTX FORMUSART(USARTNUM)
|
||||
|
||||
// LEDS: 0 - PB0, 1 - PB1
|
||||
// LEDS: 0 - PB15, 1 - PA8
|
||||
// LED0
|
||||
#define LED0_port GPIOB
|
||||
#define LED0_pin (1<<0)
|
||||
#define LED0_pin (1<<15)
|
||||
// LED1
|
||||
#define LED1_port GPIOB
|
||||
#define LED1_pin (1<<1)
|
||||
#define LED1_port GPIOA
|
||||
#define LED1_pin (1<<8)
|
||||
|
||||
#define LED_blink(x) do{if(ledsON) pin_toggle(x ## _port, x ## _pin);}while(0)
|
||||
#define LED_on(x) do{if(ledsON) pin_clear(x ## _port, x ## _pin);}while(0)
|
||||
#define LED_off(x) do{pin_set(x ## _port, x ## _pin);}while(0)
|
||||
|
||||
|
||||
// CAN address - PB14(0), PB15(1), PA8(2)
|
||||
#define READ_CAN_INV_ADDR() (((GPIOA->IDR & (1<<8))>>6)|((GPIOB->IDR & (3<<14))>>14))
|
||||
|
||||
|
||||
extern volatile uint32_t Tms;
|
||||
|
||||
extern uint8_t ledsON;
|
||||
|
||||
void gpio_setup(void);
|
||||
void iwdg_setup();
|
||||
void pause_ms(uint32_t pause);
|
||||
void Jump2Boot();
|
||||
|
||||
Reference in New Issue
Block a user