Skip to content

Commit f8cb9ea

Browse files
authored
Deprecate old DAQ Variable System (#246)
1 parent 5ade6bf commit f8cb9ea

File tree

22 files changed

+24
-474
lines changed

22 files changed

+24
-474
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ set(COMMON_MODULES
6060
common/common_defs
6161
common/log
6262
common/faults
63-
common/daq
63+
# common/daq
6464
common/amk
6565
common/modules/wheel_speeds
6666
common/syscalls

common/can_library/canpiler/codegen.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ def generate_node_header(node: Node, bus_configs: Dict, custom_types: Dict, mapp
120120
f.write("// System IDs\n")
121121
for name, val in sorted(node.system_ids.items()):
122122
# Determine primary macro name
123-
if name.startswith("daq_response"):
124-
bus_name = name.replace("daq_response_", "").upper()
125-
macro_name = f"ID_DAQ_RESPONSE_{node.macro_name}_{bus_name}"
126-
elif name == "fault_sync":
123+
if name == "fault_sync":
127124
macro_name = f"ID_FAULT_SYNC_{node.macro_name}"
128125
else:
129126
macro_name = f"ID_{name.upper()}_{node.macro_name}"

common/can_library/canpiler/parser.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,9 @@ def generate_system_ids(self) -> None:
181181
# Formula: ((priority - 1) << 26) | (node_id << 21) | (msg_index << 9)
182182
# Using high message indices (0x700+) for system messages to avoid collisions
183183

184-
# DAQ Response: Priority 3 (bits 26-28 = 2), Msg Index 0x7E0
185-
daq_base = (2 << 26) | (self.node_id << 21) | (0x7E0 << 9)
186-
187184
# Fault Sync: Priority 1 (bits 26-28 = 0), Msg Index 0x7E1
188185
self.system_ids["fault_sync"] = (0 << 26) | (self.node_id << 21) | (0x7E1 << 9)
189186

190-
for bus_name in self.busses:
191-
self.system_ids[f"daq_response_{bus_name}"] = daq_base
192-
193187
@dataclass
194188
class Fault:
195189
name: str

common/daq/CMakeLists.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MACRO(MAKE_DAQ_LIB lib_name lib_link hal_name)
2-
set(TARGET_NAME ${lib_name})
3-
add_library(${TARGET_NAME})
1+
# MACRO(MAKE_DAQ_LIB lib_name lib_link hal_name)
2+
# set(TARGET_NAME ${lib_name})
3+
# add_library(${TARGET_NAME})
44

5-
# Find all .c sources in project
6-
#file(GLOB_RECURSE glob_sources "*.c")
7-
target_sources(${TARGET_NAME} PRIVATE "daq_base.c")
5+
# # Find all .c sources in project
6+
# #file(GLOB_RECURSE glob_sources "*.c")
7+
# target_sources(${TARGET_NAME} PRIVATE "daq_base.c")
88

9-
# Find directories for '#include'
10-
# For libraries, these directories are all referenced to the top level firmware directory, CMAKE_SOURCE_DIR
11-
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_SOURCE_DIR})
9+
# # Find directories for '#include'
10+
# # For libraries, these directories are all referenced to the top level firmware directory, CMAKE_SOURCE_DIR
11+
# target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_SOURCE_DIR})
1212

13-
target_link_libraries(${TARGET_NAME} "QUEUE")
14-
target_link_libraries(${TARGET_NAME} ${lib_link})
15-
target_link_libraries(${TARGET_NAME} ${hal_name})
13+
# target_link_libraries(${TARGET_NAME} "QUEUE")
14+
# target_link_libraries(${TARGET_NAME} ${lib_link})
15+
# target_link_libraries(${TARGET_NAME} ${hal_name})
1616

17-
ENDMACRO(MAKE_DAQ_LIB)
17+
# ENDMACRO(MAKE_DAQ_LIB)
1818

19-
MAKE_DAQ_LIB(DAQ CMSIS_L432 PHAL_L432)
20-
MAKE_DAQ_LIB(DAQ_F407 CMSIS_F407 PHAL_F407)
21-
MAKE_DAQ_LIB(DAQ_F732 CMSIS_F732 PHAL_F732)
19+
# MAKE_DAQ_LIB(DAQ CMSIS_L432 PHAL_L432)
20+
# MAKE_DAQ_LIB(DAQ_F407 CMSIS_F407 PHAL_F407)
21+
# MAKE_DAQ_LIB(DAQ_F732 CMSIS_F732 PHAL_F732)

source/a_box/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES
1515
COMPONENT_NAME ${COMPONENT_NAME}
1616
COMPONENT_DIR ${CMAKE_CURRENT_LIST_DIR}
1717
LINKER_SCRIPT "STM32F407VGTx_FLASH"
18-
COMMON_LIBS "CMSIS_F407;PSCHED_F407;QUEUE;can_node_A_BOX;PHAL_F407;FAULTS_F407;m;BOOTLOADER_COMMON_F407;DAQ_F407"
18+
COMMON_LIBS "CMSIS_F407;PSCHED_F407;QUEUE;can_node_A_BOX;PHAL_F407;FAULTS_F407;m;BOOTLOADER_COMMON_F407"
1919
)
2020
COMMON_FIRMWARE_COMPONENT(${TARGET_NAME})

source/a_box/daq/daq.c

Lines changed: 0 additions & 68 deletions
This file was deleted.

source/a_box/daq/daq.h

Lines changed: 0 additions & 53 deletions
This file was deleted.

source/a_box/main.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "stm32f407xx.h"
1313

1414
/* Module Includes */
15-
#include "daq.h"
1615
#include "main.h"
1716
#include "orion.h"
1817
#include "tmu.h"
@@ -89,9 +88,6 @@ extern uint8_t orion_error;
8988

9089
extern uint32_t can_mbx_last_send_time[NUM_CAN_PERIPHERALS][CAN_TX_MAILBOX_CNT];
9190

92-
bool bms_daq_override = false;
93-
bool bms_daq_stat = false;
94-
9591
void PHAL_FaultHandler();
9692
extern void HardFault_Handler();
9793

@@ -157,13 +153,6 @@ int main(void) {
157153
CAN_library_init();
158154
orionInit();
159155

160-
bms_daq_override = false;
161-
bms_daq_stat = false;
162-
163-
if (daqInit(&q_tx_can[CAN1_IDX][CAN_MAILBOX_LOW_PRIO])) {
164-
HardFault_Handler();
165-
}
166-
167156
/* Module init */
168157
schedInit(APB1ClockRateHz * 2); // See Datasheet DS11451 Figure. 4 for clock tree
169158

@@ -175,7 +164,6 @@ int main(void) {
175164
taskCreate(orionChargePeriodic, 50);
176165
taskCreate(heartBeatTask, 100);
177166
taskCreate(sendhbmsg, 500);
178-
taskCreate(daqPeriodic, DAQ_UPDATE_PERIOD);
179167
taskCreate(readCurrents, 50);
180168
taskCreateBackground(CAN_tx_update);
181169
taskCreateBackground(CAN_rx_update);
@@ -270,16 +258,11 @@ void monitorStatus() {
270258

271259
// PHAL_writeGPIO(BMS_STATUS_GPIO_Port, BMS_STATUS_Pin, !bms_err);
272260

273-
if (bms_daq_override | tmu_daq_override)
274-
PHAL_toggleGPIO(ERROR_LED_GPIO_Port, ERROR_LED_Pin);
275-
else
276-
PHAL_writeGPIO(ERROR_LED_GPIO_Port, ERROR_LED_Pin, bms_err);
261+
PHAL_writeGPIO(ERROR_LED_GPIO_Port, ERROR_LED_Pin, bms_err);
277262

278263
setFault(ID_IMD_FAULT, imd_err);
279264

280265
uint8_t stat = bms_err | tmu_err;
281-
if (bms_daq_override)
282-
stat = bms_daq_stat;
283266
PHAL_writeGPIO(BMS_STATUS_GPIO_Port, BMS_STATUS_Pin, stat);
284267
}
285268

source/a_box/orion/orion.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "A_BOX.h"
66
#include "common/faults/faults.h"
77
#include "common_defs.h"
8-
#include "daq.h"
98

109
uint8_t charge_request_user = false; // Enable charge algo
1110
uint16_t user_charge_current_request = 0;

source/daq/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES
1515
COMPONENT_NAME ${COMPONENT_NAME}
1616
COMPONENT_DIR ${CMAKE_CURRENT_LIST_DIR}
1717
LINKER_SCRIPT "STM32F407VGTx_FLASH"
18-
COMMON_LIBS "can_node_DAQ;CMSIS_F407;QUEUE;DAQ_F407;FREERTOS_F407"
18+
COMMON_LIBS "can_node_DAQ;CMSIS_F407;PHAL_F407;QUEUE;FREERTOS_F407"
1919
)
2020
COMMON_FIRMWARE_COMPONENT(${TARGET_NAME})

0 commit comments

Comments
 (0)