Compare commits
2 Commits
4f43895235
...
838c6195bb
| Author | SHA1 | Date | |
|---|---|---|---|
| 838c6195bb | |||
| ea4c10a093 |
@ -1,8 +1,11 @@
|
|||||||
#include "slave_monitoring.h"
|
#include "slave_monitoring.h"
|
||||||
|
|
||||||
#include "stm32f3xx_hal.h"
|
#include "main.h"
|
||||||
#include "ts_state_machine.h"
|
#include "ts_state_machine.h"
|
||||||
|
|
||||||
|
#include "stm32f3xx_hal.h"
|
||||||
|
#include "stm32f3xx_hal_gpio.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -18,6 +21,14 @@ void slaves_init() {
|
|||||||
memset(&slaves[i].voltages, 0, sizeof(slaves[i].voltages));
|
memset(&slaves[i].voltages, 0, sizeof(slaves[i].voltages));
|
||||||
memset(&slaves[i].temperatures, 0, sizeof(slaves[i].temperatures));
|
memset(&slaves[i].temperatures, 0, sizeof(slaves[i].temperatures));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HAL_GPIO_WritePin(SLAVE_POWER_0_GPIO_Port, SLAVE_POWER_0_Pin, GPIO_PIN_SET);
|
||||||
|
HAL_GPIO_WritePin(SLAVE_POWER_1_GPIO_Port, SLAVE_POWER_1_Pin, GPIO_PIN_RESET);
|
||||||
|
HAL_GPIO_WritePin(SLAVE_POWER_DSEL_GPIO_Port, SLAVE_POWER_DSEL_Pin,
|
||||||
|
GPIO_PIN_RESET);
|
||||||
|
// TODO: Enable & read out current
|
||||||
|
HAL_GPIO_WritePin(SLAVE_POWER_DEN_GPIO_Port, SLAVE_POWER_DEN_Pin,
|
||||||
|
GPIO_PIN_RESET);
|
||||||
}
|
}
|
||||||
|
|
||||||
void slaves_check() {
|
void slaves_check() {
|
||||||
|
|||||||
@ -160,7 +160,6 @@ void ts_sm_set_relay_position(Relay relay, int closed) {
|
|||||||
static int neg_closed = 0;
|
static int neg_closed = 0;
|
||||||
static int pos_closed = 0;
|
static int pos_closed = 0;
|
||||||
static int precharge_closed = 0;
|
static int precharge_closed = 0;
|
||||||
static uint32_t last_close_timestamp = 0;
|
|
||||||
|
|
||||||
GPIO_PinState state = closed ? GPIO_PIN_SET : GPIO_PIN_RESET;
|
GPIO_PinState state = closed ? GPIO_PIN_SET : GPIO_PIN_RESET;
|
||||||
switch (relay) {
|
switch (relay) {
|
||||||
|
|||||||
Reference in New Issue
Block a user