-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Summary This should be the PR that gets a drivable dashboard on the car. ### Changelist - Logging - Improved Types/DS for GPIO ### Testing Done - [x] runs on local dev - [x] runs on dev board - [x] runs on aux dim board ### Resolved Issues - Solves logging in [SW-87](https://ubcformulaelectric.atlassian.net/jira/software/projects/SW/boards/20?selectedIssue=SW-87) - Solves GPIO Navigation in [SW-72](https://ubcformulaelectric.atlassian.net/jira/software/projects/SW/boards/20?selectedIssue=SW-72) ### Checklist *Please change `[ ]` to `[x]` when you are ready.* - [x] I have read and followed the code conventions detailed in [README.md](../README.md) (*This will save time for both you and the reviewer!*). - [x] If this pull request is longer then **500** lines, I have provided *explicit* justification in the summary above explaining why I *cannot* break this up into multiple pull requests (*Small PR's are faster and less painful for everyone involved!*). [SW-87]: https://ubcformulaelectric.atlassian.net/browse/SW-87?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [SW-72]: https://ubcformulaelectric.atlassian.net/browse/SW-72?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Gus Tahara-Edmonds <[email protected]> Co-authored-by: peterjinweigu <[email protected]> Co-authored-by: Edwin <[email protected]>
- Loading branch information
1 parent
09e4444
commit 1118ff5
Showing
103 changed files
with
3,198 additions
and
1,565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
{ | ||
"messages": [ | ||
] | ||
"messages": [ | ||
"FSM_Wheels", | ||
"FSM_Apps", | ||
"FSM_Brake", | ||
"BMS_VoltageAndChargeStats", | ||
"BMS_TractiveSystem", | ||
"BMS_CellTemperatures", | ||
"VC_PowerLimit", | ||
"VC_GlobalShdnNodeStatus", | ||
"INVL_Temperatures1", | ||
"INVR_Temperatures3" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
E:\environment-setup-armv8a-poky-linux.bat | ||
|
||
& "E:\sysroots\x86_64-w64-mingw32\usr\bin\cmake.exe" -G Ninja -DPLATFORM=dimos -DHANDLE_DEPS=ON -DFIX_FORMATTING=OFF -DTARGET=dev -DUSE_COMMIT_INFO=MINIMAL -S . -B ./build_dimos_deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,6 @@ compile_commands.json | |
|
||
**/*.txt | ||
!**/*/CMakeLists.txt | ||
|
||
flash.ps1 | ||
flash.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
cmake_minimum_required(VERSION 3.24) | ||
cmake_minimum_required(VERSION 3.22.3) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
if("${TARGET}" STREQUAL "deploy") | ||
set(EXECUTABLE_NAME dimos) | ||
if ("${TARGET}" STREQUAL "deploy") | ||
elseif ("${TARGET}" STREQUAL "dev") | ||
set(EXECUTABLE_NAME dimos_dev) | ||
else() | ||
else () | ||
message(FATAL_ERROR "❌ Unknown target ${TARGET}") | ||
endif() | ||
endif () | ||
set(EXECUTABLE_NAME dimos) | ||
|
||
add_subdirectory(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule assets
updated
14 files
+1 −0 | .gitignore | |
+12 −3 | SwitcherEventIcons/Acceleration.svg | |
+0 −3 | SwitcherEventIcons/Autocross.svg | |
+18 −13 | SwitcherEventIcons/Brake.svg | |
+27 −2 | SwitcherEventIcons/Endurance.svg | |
+10 −2 | SwitcherEventIcons/LV.svg | |
+19 −1 | SwitcherEventIcons/Skidpad.svg | |
+20 −0 | SwitcherEventIcons/SoftwareDebug.svg | |
+ − | Zheng_Edwin.png | |
+3 −0 | battery.svg | |
+20 −0 | charge.svg | |
+25 −0 | regen.svg | |
+4 −2 | resources.qrc | |
+6 −0 | sdloop_battery.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
#include "can.h" | ||
#include <iostream> | ||
#include <thread> | ||
#include <chrono> | ||
#include <qlogging.h> | ||
|
||
using std::cout, std::endl; | ||
#include "can.h" | ||
#include "dev_io_utils.h" | ||
|
||
Result<std::monostate, CanConnectionError> Can_Init() | ||
{ | ||
cout << "Can Initialized" << endl; | ||
qInfo("Can Initialized"); | ||
return std::monostate{}; | ||
} | ||
|
||
Result<JsonCanMsg, CanReadError> Can_Read() | ||
{ | ||
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); | ||
cout << "Can Read Requested\n"; | ||
if (const WaitDelegateResult res = wait_delegate_thread(); res == WaitDelegateResult::INTERRUPTED) | ||
return CanReadError::Timeout; | ||
// qInfo("Can Read Requested"); | ||
return JsonCanMsg{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | ||
} | ||
|
||
Result<std::monostate, CanWriteError> Can_Write(const JsonCanMsg *msg) | ||
{ | ||
cout << "Can with id " << msg->std_id << " Written\n"; | ||
// qInfo("Can with id %d Written", msg->std_id); | ||
return std::monostate{}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "dev_io_utils.h" | ||
|
||
#include <QThread> | ||
#include <thread> | ||
|
||
static constexpr int TIMEOUT_TIME_MSEC = 3000; | ||
static constexpr int RESPONSE_TIME = 30; | ||
static constexpr int CYCLES = TIMEOUT_TIME_MSEC / RESPONSE_TIME; // CYCLES * RESPONSE_TIME = TIMEOUT_TIME_MSEC | ||
|
||
WaitDelegateResult wait_delegate_thread() | ||
{ | ||
for (int i = 0; i < CYCLES; i++) | ||
{ | ||
std::this_thread::sleep_for(std::chrono::milliseconds(RESPONSE_TIME)); | ||
if (QThread::currentThread()->isInterruptionRequested()) | ||
return WaitDelegateResult::INTERRUPTED; | ||
} | ||
|
||
return WaitDelegateResult::TIMEOUT; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
enum class WaitDelegateResult | ||
{ | ||
TIMEOUT, | ||
INTERRUPTED | ||
}; | ||
|
||
[[nodiscard]] WaitDelegateResult wait_delegate_thread(); |
Oops, something went wrong.