Skip to content

Commit 8363976

Browse files
authored
Backplane Single Flight Logs (#310)
1 parent 0a32351 commit 8363976

4 files changed

Lines changed: 8 additions & 34 deletions

File tree

app/backplane/sensor_module/.idea/editor.xml

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/backplane/sensor_module/src/c_sensor_module.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,8 @@ static auto alertMsgQueue = CMsgqMessagePort<NAlerts::AlertPacket>(alertQueue);
2121

2222
CSensorModule::CSensorModule()
2323
: CProjectConfiguration(), sensorDataBroadcastMessagePort(broadcastMsgQueue), downlinkMessagePort(downlinkMsgQueue),
24-
sensorDataLogMessagePort(dataLogMsgQueue), alertMessagePort(alertMsgQueue), flight_log{generateFlightLogPath()} {}
24+
sensorDataLogMessagePort(dataLogMsgQueue), alertMessagePort(alertMsgQueue), flight_log{"/lfs/flight_log.txt"} {}
2525

26-
std::string CSensorModule::generateFlightLogPath() {
27-
constexpr size_t MAX_FLIGHT_LOG_PATH_SIZE = 32;
28-
char flightLogPath[MAX_FLIGHT_LOG_PATH_SIZE] = {0};
29-
for (size_t i = 0; i < 100; i++) {
30-
snprintf(flightLogPath, MAX_FLIGHT_LOG_PATH_SIZE, "/lfs/flight_log%02d.txt", i);
31-
struct fs_dirent ent;
32-
int ret = fs_stat(flightLogPath, &ent);
33-
if (ret == -ENOENT) {
34-
// This path works
35-
LOG_INF("Using %s for flight log", flightLogPath);
36-
break;
37-
} else if (ret != 0) {
38-
LOG_WRN("Error reading filesystem for flight log. (error %d) Using name %s", ret, flightLogPath);
39-
break;
40-
}
41-
// otherwise, keep counting up
42-
}
43-
std::string copystr{flightLogPath};
44-
return copystr;
45-
}
4626
void CSensorModule::AddTenantsToTasks() {
4727
// Networking
4828
networkTask.AddTenant(broadcastTenant);

app/ground/tftp_server/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
set(FSW_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
2+
include(${FSW_ROOT}/cmake/Snippets.cmake)
3+
4+
AddCommonSnippets()
5+
AddDebugSnippets()
6+
17
cmake_minimum_required(VERSION 3.13.1)
28
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
39

snippets/complete-shell/complete-shell.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CONFIG_SHELL=y
22
CONFIG_DEVICE_SHELL=y
33
CONFIG_FILE_SYSTEM_SHELL=y
4+
CONFIG_FLASH_SHELL=y
45
CONFIG_GPIO_SHELL=y
56
CONFIG_I2C_SHELL=y
67
CONFIG_KERNEL_SHELL=y

0 commit comments

Comments
 (0)