Mirror TSActive on RSD. Don't do anything else.
This commit is contained in:
		@ -10,7 +10,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "stm32h7xx_hal.h"
 | 
					#include "stm32h7xx_hal.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define CAN_ID_AMS_STATUS 0x00A
 | 
				
			||||||
 | 
					#define CAN_ID_AMS_IN 0x00B
 | 
				
			||||||
#define CAN_ID_SLAVE_STATUS_BASE 0x080
 | 
					#define CAN_ID_SLAVE_STATUS_BASE 0x080
 | 
				
			||||||
#define CAN_ID_CHARGER_ACTIVE 0x200
 | 
					#define CAN_ID_CHARGER_ACTIVE 0x200
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -10,6 +10,8 @@
 | 
				
			|||||||
#include "can-halal.h"
 | 
					#include "can-halal.h"
 | 
				
			||||||
#include "slave_handler.h"
 | 
					#include "slave_handler.h"
 | 
				
			||||||
#include "b_cccv_algo.h"
 | 
					#include "b_cccv_algo.h"
 | 
				
			||||||
 | 
					#include "charger_control.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void initCan(FDCAN_HandleTypeDef *hcan)
 | 
					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)
 | 
					void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if ((id & 0xFF0) == CAN_ID_SLAVE_STATUS_BASE) {
 | 
						if ((id & 0xFF0) == CAN_ID_SLAVE_STATUS_BASE) {
 | 
				
			||||||
	  slaves_handle_status(data);
 | 
					//	  slaves_handle_status(data);
 | 
				
			||||||
	  return;
 | 
						  return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (id == CAN_ID_CHARGER_ACTIVE)
 | 
						/*if (id == CAN_ID_CHARGER_ACTIVE)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if(data[0] == 1)
 | 
							if(data[0] == 1)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@ -36,5 +38,20 @@ void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data)
 | 
				
			|||||||
			stopcharging();
 | 
								stopcharging();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return;
 | 
							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)
 | 
						if((HAL_GetTick() - lasttick) > 1000)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		float maxvoltage = slaves_get_maximum_voltage();
 | 
					//		float maxvoltage = slaves_get_maximum_voltage();
 | 
				
			||||||
		lasttick = HAL_GetTick();
 | 
					//		lasttick = HAL_GetTick();
 | 
				
			||||||
		chargingloop(slaves_get_maximum_voltage());
 | 
					//		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);
 | 
						//  HAL_Delay(500);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  /* USER CODE END 3 */
 | 
					  /* USER CODE END 3 */
 | 
				
			||||||
 | 
				
			|||||||
@ -36,7 +36,7 @@
 | 
				
			|||||||
    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
 | 
					    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
 | 
				
			||||||
    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
 | 
					    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
 | 
				
			||||||
    <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
 | 
					    <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
 | 
				
			||||||
    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
 | 
					    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
 | 
				
			||||||
    <booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
 | 
					    <booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
 | 
				
			||||||
    <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
 | 
					    <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
 | 
				
			||||||
    <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
 | 
					    <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user