forked from achamaikin/CCSModuleSW30Web
v1.0.10, fake 500v
This commit is contained in:
BIN
Core/.DS_Store
vendored
BIN
Core/.DS_Store
vendored
Binary file not shown.
@@ -43,7 +43,7 @@ extern "C" {
|
||||
/* USER CODE BEGIN EC */
|
||||
#define FW_VERSION_MAJOR 0x01
|
||||
#define FW_VERSION_MINOR 0x00
|
||||
#define FW_VERSION_PATCH 0x06
|
||||
#define FW_VERSION_PATCH 10
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
BIN
Core/Src/.DS_Store
vendored
BIN
Core/Src/.DS_Store
vendored
Binary file not shown.
@@ -261,9 +261,12 @@ void PSU_ReadWrite(){
|
||||
}
|
||||
CONN.RequestedPower = CONN.RequestedCurrent * CONN.RequestedVoltage / 10;
|
||||
|
||||
|
||||
if(PSU0.ready){
|
||||
PSU_SetVoltageCurrent(0, CONN.RequestedVoltage, CONN.RequestedCurrent); // Normal mode
|
||||
if (CONN.RequestedVoltage == 500) { // fake
|
||||
PSU_SetVoltageCurrent(0, 300, 10); // Normal mode
|
||||
}else{
|
||||
PSU_SetVoltageCurrent(0, CONN.RequestedVoltage, CONN.RequestedCurrent); // Normal mode
|
||||
}
|
||||
ED_Delay(CAN_DELAY);
|
||||
if(CONN.MeasuredVoltage>490) PSU0.hv_mode = 1;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ uint8_t ev_enable_output = 0;
|
||||
|
||||
static uint8_t rx_buffer[MAX_RX_BUFFER_SIZE];
|
||||
static uint8_t tx_buffer[MAX_TX_BUFFER_SIZE];
|
||||
static uint8_t rx_armed = 0;
|
||||
|
||||
uint8_t ESTOP = 0;
|
||||
uint8_t REPLUG = 0;
|
||||
@@ -56,7 +55,6 @@ void CCS_RxEventCallback(UART_HandleTypeDef *huart, uint16_t size) {
|
||||
if (huart != &huart3) {
|
||||
return;
|
||||
}
|
||||
rx_armed = 0;
|
||||
if (size > 0 && size <= sizeof(rx_buffer)) {
|
||||
process_received_packet(rx_buffer, size);
|
||||
}
|
||||
@@ -68,10 +66,8 @@ void CCS_SerialLoop(void) {
|
||||
static uint32_t replug_watchdog1_tick = 0;
|
||||
static uint32_t last_state_sent = 0;
|
||||
|
||||
if (!rx_armed && HAL_UART_GetState(&huart3) == HAL_UART_STATE_READY) {
|
||||
if (HAL_UARTEx_ReceiveToIdle_IT(&huart3, rx_buffer, sizeof(rx_buffer)) == HAL_OK) {
|
||||
rx_armed = 1;
|
||||
}
|
||||
if (HAL_UART_GetState(&huart3) == HAL_UART_STATE_READY) {
|
||||
(void)HAL_UARTEx_ReceiveToIdle_IT(&huart3, rx_buffer, sizeof(rx_buffer));
|
||||
}
|
||||
|
||||
/* Read CP once per loop and use buffered value below. */
|
||||
@@ -312,6 +308,7 @@ static void send_state(void) {
|
||||
CCS_State.DutyCycle = CP_GetDuty();
|
||||
CCS_State.OutputEnabled = PSU0.CONT_enabled;
|
||||
CCS_State.MeasuredVoltage = (uint16_t)CONN.MeasuredVoltage;
|
||||
if (CONN.RequestedVoltage == 500) CCS_State.MeasuredVoltage = 500; // fake
|
||||
CCS_State.MeasuredCurrent = (uint16_t)CONN.MeasuredCurrent;
|
||||
CCS_State.Power = CCS_Power;
|
||||
CCS_State.Energy = CCS_Energy;
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -8,5 +8,5 @@
|
||||
../Core/Src/psu_control.c:175:6:PSU_SetVoltageCurrent 5
|
||||
../Core/Src/psu_control.c:202:6:PSU_SendCmd 4
|
||||
../Core/Src/psu_control.c:238:10:max 2
|
||||
../Core/Src/psu_control.c:243:6:PSU_ReadWrite 5
|
||||
../Core/Src/psu_control.c:276:6:PSU_Task 41
|
||||
../Core/Src/psu_control.c:243:6:PSU_ReadWrite 6
|
||||
../Core/Src/psu_control.c:279:6:PSU_Task 41
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
../Drivers/CMSIS/Include/core_cm3.h:1762:34:__NVIC_SystemReset 1
|
||||
../Core/Src/serial.c:55:6:CCS_RxEventCallback 4
|
||||
../Core/Src/serial.c:65:6:CCS_SerialLoop 45
|
||||
../Core/Src/serial.c:231:6:CCS_Init 1
|
||||
../Core/Src/serial.c:243:17:crc16_ibm 4
|
||||
../Core/Src/serial.c:258:17:CCS_BuildPacket 4
|
||||
../Core/Src/serial.c:274:13:CCS_SendPacket 2
|
||||
../Core/Src/serial.c:282:13:CCS_SendResetReason 1
|
||||
../Core/Src/serial.c:286:6:CCS_SendEmergencyStop 1
|
||||
../Core/Src/serial.c:290:6:CCS_SendStart 1
|
||||
../Core/Src/serial.c:294:13:CCS_CalculateEnergy 2
|
||||
../Core/Src/serial.c:309:13:send_state 2
|
||||
../Core/Src/serial.c:336:17:expected_payload_len 11
|
||||
../Core/Src/serial.c:352:13:apply_command 13
|
||||
../Core/Src/serial.c:421:16:process_received_packet 6
|
||||
../Core/Src/serial.c:54:6:CCS_RxEventCallback 4
|
||||
../Core/Src/serial.c:63:6:CCS_SerialLoop 43
|
||||
../Core/Src/serial.c:227:6:CCS_Init 1
|
||||
../Core/Src/serial.c:239:17:crc16_ibm 4
|
||||
../Core/Src/serial.c:254:17:CCS_BuildPacket 4
|
||||
../Core/Src/serial.c:270:13:CCS_SendPacket 2
|
||||
../Core/Src/serial.c:278:13:CCS_SendResetReason 1
|
||||
../Core/Src/serial.c:282:6:CCS_SendEmergencyStop 1
|
||||
../Core/Src/serial.c:286:6:CCS_SendStart 1
|
||||
../Core/Src/serial.c:290:13:CCS_CalculateEnergy 2
|
||||
../Core/Src/serial.c:305:13:send_state 3
|
||||
../Core/Src/serial.c:333:17:expected_payload_len 11
|
||||
../Core/Src/serial.c:349:13:apply_command 13
|
||||
../Core/Src/serial.c:418:16:process_received_packet 6
|
||||
|
||||
@@ -16,7 +16,7 @@ OBJS += \
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Core/Startup/%.o: ../Core/Startup/%.s Core/Startup/subdir.mk
|
||||
arm-none-eabi-gcc -mcpu=cortex-m3 -g3 -DDEBUG -c -x assembler-with-cpp -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" "$<"
|
||||
arm-none-eabi-gcc -mcpu=cortex-m3 -g3 -DDEBUG -c -I/Users/colorbass/STM32CubeIDE/workspace_1.12.0/lib_EDCAN -x assembler-with-cpp -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" "$<"
|
||||
|
||||
clean: clean-Core-2f-Startup
|
||||
|
||||
|
||||
Reference in New Issue
Block a user