usbcan_relay: add standalone buttons reactions

This commit is contained in:
2021-09-10 12:06:01 +03:00
parent 50fdc3e104
commit 1c4c7d9636
91 changed files with 200 additions and 547 deletions

View File

@@ -22,6 +22,9 @@
#include <stm32f0.h>
// default CAN bus speed in kbaud
#define DEFAULT_CAN_SPEED (250)
#define SYSMEM03x 0x1FFFEC00
#define SYSMEM04x 0x1FFFC400
#define SYSMEM05x 0x1FFFEC00
@@ -55,6 +58,7 @@ extern GPIO_TypeDef *R_ports[RelaysNO];
extern const uint32_t R_pins[RelaysNO];
#define Relay_ON(x) do{pin_set(R_ports[x], R_pins[x]);}while(0)
#define Relay_OFF(x) do{pin_clear(R_ports[x], R_pins[x]);}while(0)
#define Relay_TGL(x) do{pin_toggle(R_ports[x], R_pins[x]);}while(0)
#define Relay_chk(x) (pin_read(R_ports[x], R_pins[x]))
// Buttons amount