Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions GUI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ TankControllerLib.o : Godmode.o
$(LIBRARIES)/Keypad/src/*.cpp \
$(LIBRARIES)/LiquidCrystal/src/*.cpp \
$(LIBRARIES)/RTClib/src/*.cpp \
$(LIBRARIES)/SdFat/src/*.cpp \
$(LIBRARIES)/SdFat/src/*/*.cpp \

echo

Expand Down
5 changes: 3 additions & 2 deletions GUI/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ if [ ${PWD##*/} != "GUI" ]; then
fi
../scripts/install_libraries.sh
python3 -m pip install wxPython pybind11
filePath=`bundle exec which arduino_library_location.rb`
export ARDUINO_CI=${filePath%/bin/*}/gems/arduino_ci-1.3.0/cpp/arduino
x=`bundle exec which arduino_library_location.rb`
y=`echo ${x%/bin/*}/bundler/gems/arduino_ci-*`
export ARDUINO_CI=${y}/cpp/arduino
export TC_PATH=`(cd ..; pwd)`/src
make clean
(mkdir -p .build; cd .build; make -f ../Makefile)
Expand Down
27 changes: 2 additions & 25 deletions GUI/libTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
namespace py = pybind11;
char lcdLine[17];
uint32_t msOffset = 0;
std::queue<string> paths;

// function prototypes
void loop();
Expand Down Expand Up @@ -156,37 +155,15 @@ string readSerial1() {
return readSerial(1);
}

void addPath(File *entry, String parentPath) {
if (!entry->isDirectory()) {
paths.push(parentPath + entry->name());
}
}

void sdInit() {
std::queue<string> empty;
std::swap(paths, empty);
SD_TC::instance()->visit(addPath);
}

string sdNextKey() {
if (paths.empty()) {
return string("");
}
return paths.front();
return string("");
}

string sdNextValue() {
char buffer[4096];
File entry = SD_TC::instance()->open(String(paths.front().c_str()));
size_t size = entry.size();
if (sizeof(buffer) - 1 < size) {
size = sizeof(buffer) - 1;
}
entry.read(buffer, size);
buffer[size] = '\0';
string result = string(buffer);
paths.pop();
return result;
return string("");
}

void setTemperature(float value) {
Expand Down