Mirror TSActive on RSD. Don't do anything else.
This commit is contained in:
@ -10,6 +10,8 @@
|
||||
#include "can-halal.h"
|
||||
#include "slave_handler.h"
|
||||
#include "b_cccv_algo.h"
|
||||
#include "charger_control.h"
|
||||
|
||||
|
||||
void initCan(FDCAN_HandleTypeDef *hcan)
|
||||
{
|
||||
@ -20,11 +22,11 @@ void initCan(FDCAN_HandleTypeDef *hcan)
|
||||
void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data)
|
||||
{
|
||||
if ((id & 0xFF0) == CAN_ID_SLAVE_STATUS_BASE) {
|
||||
slaves_handle_status(data);
|
||||
// slaves_handle_status(data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == CAN_ID_CHARGER_ACTIVE)
|
||||
/*if (id == CAN_ID_CHARGER_ACTIVE)
|
||||
{
|
||||
if(data[0] == 1)
|
||||
{
|
||||
@ -36,5 +38,20 @@ void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data)
|
||||
stopcharging();
|
||||
}
|
||||
return;
|
||||
}*/
|
||||
switch (id) {
|
||||
case CAN_ID_AMS_STATUS: {
|
||||
int sdc_closed = data[0] >> 7;
|
||||
if (sdc_closed == 0) {
|
||||
charger_control_disable_remote();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CAN_ID_AMS_IN: {
|
||||
int active = data[0] & 0x01;
|
||||
if (active) {
|
||||
charger_control_enable_remote();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,12 +155,12 @@ int main(void)
|
||||
|
||||
if((HAL_GetTick() - lasttick) > 1000)
|
||||
{
|
||||
float maxvoltage = slaves_get_maximum_voltage();
|
||||
lasttick = HAL_GetTick();
|
||||
chargingloop(slaves_get_maximum_voltage());
|
||||
// float maxvoltage = slaves_get_maximum_voltage();
|
||||
// lasttick = HAL_GetTick();
|
||||
// chargingloop(slaves_get_maximum_voltage());
|
||||
HAL_GPIO_TogglePin(STATUS_LED_2_GPIO_Port, STATUS_LED_2_Pin);
|
||||
}
|
||||
|
||||
// HAL_GPIO_TogglePin(STATUS_LED_2_GPIO_Port, STATUS_LED_2_Pin);
|
||||
// HAL_Delay(500);
|
||||
}
|
||||
/* USER CODE END 3 */
|
||||
|
||||
Reference in New Issue
Block a user