Skip to content

Commit bdf04ef

Browse files
Fixed build, moved main.cpp to src/
1 parent 18c0e62 commit bdf04ef

File tree

3 files changed

+1
-37
lines changed

3 files changed

+1
-37
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
4848

4949
# Add sources to executable
5050
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
51-
main.cpp
51+
src/main.cpp
5252
src/globals.cpp
5353
src/heartbeat.c
5454
src/id_eeprom.c

src/drivers/gps/ublox_gps_interface.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ void UbxGpsInterface::ProcessUbxPacket(const uint8_t *data, const size_t &size)
160160
// substract class, id and length
161161
if (size - 4 == sizeof(UbxNavPvt)) {
162162
const auto *msg = reinterpret_cast<const UbxNavPvt *>(data + 4);
163-
SEGGER_SYSVIEW_MarkStart(1);
164163
HandleNavPvt(msg);
165-
SEGGER_SYSVIEW_MarkStop(1);
166164
} else {
167165
ULOG_WARNING("size mismatch for PVT message!");
168166
}

main.cpp renamed to src/main.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,6 @@ MowerService mower_service{3};
2929
ImuService imu_service{4};
3030
PowerService power_service{5};
3131

32-
xbot::driver::gps::UbxGpsInterface gps{};
33-
34-
THD_WORKING_AREA(testWa, 100);
35-
void testThreadFunc(void* arg) {
36-
(void)arg;
37-
while(1) {
38-
auto start = chVTGetSystemTime();
39-
while(chVTTimeElapsedSinceX(start) < TIME_MS2I(100)) {
40-
41-
}
42-
chThdYield();
43-
}
44-
}
45-
46-
47-
int i = 0;
48-
void gpsUpdated(const xbot::driver::gps::GpsDriver::GpsState &new_state) {
49-
(void)new_state;
50-
etl::string<100> lat{};
51-
etl::format_spec format{};
52-
format.width(8).fill(' ').precision(3);
53-
lat += "lat:";
54-
etl::to_string(new_state.pos_lat, lat, format, true);
55-
lat += "lon:";
56-
etl::to_string(new_state.pos_lon, lat, format, true);
57-
58-
SEGGER_RTT_printf(0, "got data: %s!\n", lat.c_str());
59-
i++;
60-
}
6132
/*
6233
* Application entry point.
6334
*/
@@ -124,11 +95,6 @@ int main(void) {
12495
diff_drive.start();
12596
mower_service.start();
12697

127-
// chThdCreateStatic(testWa, sizeof(testWa), NORMALPRIO, testThreadFunc, NULL);
128-
gps.SetStateCallback(etl::delegate<void(const xbot::driver::gps::GpsDriver::GpsState &new_state)>::create<gpsUpdated>());
129-
gps.SetDatum(49.0, 10.0, 150);
130-
gps.StartDriver(&UARTD6, 921600);
131-
13298
// Subscribe to global events and dispatch to our services
13399
event_listener_t event_listener;
134100
chEvtRegister(&mower_events, &event_listener, 1);

0 commit comments

Comments
 (0)