2 Commits

Author SHA1 Message Date
838c6195bb Configure PROFET 2023-03-12 21:15:32 +01:00
ea4c10a093 Remove unused variable 2023-03-12 21:10:51 +01:00
2 changed files with 12 additions and 2 deletions

View File

@ -1,8 +1,11 @@
#include "slave_monitoring.h"
#include "stm32f3xx_hal.h"
#include "main.h"
#include "ts_state_machine.h"
#include "stm32f3xx_hal.h"
#include "stm32f3xx_hal_gpio.h"
#include <stdint.h>
#include <string.h>
@ -18,6 +21,14 @@ void slaves_init() {
memset(&slaves[i].voltages, 0, sizeof(slaves[i].voltages));
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() {

View File

@ -160,7 +160,6 @@ void ts_sm_set_relay_position(Relay relay, int closed) {
static int neg_closed = 0;
static int pos_closed = 0;
static int precharge_closed = 0;
static uint32_t last_close_timestamp = 0;
GPIO_PinState state = closed ? GPIO_PIN_SET : GPIO_PIN_RESET;
switch (relay) {