-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work in progress, restructured everything, missing led output and cor…
…rect state transitions for controller
- Loading branch information
1 parent
d939dfd
commit 6703c02
Showing
41 changed files
with
682 additions
and
1,920 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
#include "bgeigie_connector.h" | ||
#include "user_config.h" | ||
#include "debugger.h" | ||
#include "identifiers.h" | ||
|
||
BGeigieConnector::BGeigieConnector(Stream& serial_connection) : _serial_connection(serial_connection), _buffer("") { | ||
BGeigieConnector::BGeigieConnector(Stream& serial_connection) : | ||
Worker<Reading>(k_worker_bgeigie_connector, Reading(), 4000), | ||
_serial_connection(serial_connection), | ||
_buffer("") { | ||
} | ||
|
||
bool BGeigieConnector::get_reading(Reading& out) { | ||
int8_t BGeigieConnector::produce_data() { | ||
while(_serial_connection.available() > 0) { | ||
char c = static_cast<char>(_serial_connection.read()); | ||
_buffer += c; | ||
if(c == '\n') { | ||
// DEBUG_PRINT("New reading: "); DEBUG_PRINT(_buffer); | ||
out = _buffer.c_str(); | ||
_buffer = ""; | ||
return true; | ||
data = _buffer.c_str(); | ||
return data.get_status() | k_reading_parsed ? WorkerStatus::e_worker_data_read : WorkerStatus::e_worker_error; | ||
} | ||
} | ||
return false; | ||
return WorkerStatus::e_worker_idle; | ||
} |
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
Oops, something went wrong.