Skip to content

Commit

Permalink
reading works yay
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed May 9, 2021
1 parent 8a53288 commit 895b114
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define GREAT 1
#define PER GREAT


void chargeButtonPressed();

struct GuiItems
{
Expand Down Expand Up @@ -132,7 +132,8 @@ void readTheCanBusYo()
}
gui_items.can_mtx.unlock();

if (rx_data.can_id == ELCON_READ_ADDR)
uint32_t id = rx_data.getId();
if (id == ELCON_READ_ADDR)
{
actual_current = ((double) ((rx_data.data[0] << 8)
| (rx_data.data[1]))) / 10;
Expand Down Expand Up @@ -234,6 +235,12 @@ void connectButtonPressed()
can->Close();
gui_items.can_mtx.unlock();
gui_items.charge_button->setEnabled(false);

// toggle back to start charging
if (gui_items.charge_button->text() == "Stop Charging")
{
chargeButtonPressed();
}
}

}
Expand Down

0 comments on commit 895b114

Please sign in to comment.