mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-14 19:51:04 +00:00
improve handling of when to process bluetooth state change and add TODO for reading OBD2 data
This commit is contained in:
@@ -37,7 +37,12 @@ void obd2_bt_get_state(obd2_bt_t *bt, char *state)
|
||||
|
||||
void obd2_bt_process(obd2_bt_t *bt)
|
||||
{
|
||||
if (bt->state != BT_CONNECTED)
|
||||
{
|
||||
__UINT32_TYPE__ bt_state = digitalRead(BT_STATE_PIN);
|
||||
|
||||
if (bt_state != bt->state)
|
||||
{
|
||||
if (bt_state)
|
||||
{
|
||||
bt->state = BT_CONNECTED;
|
||||
@@ -47,4 +52,8 @@ void obd2_bt_process(obd2_bt_t *bt)
|
||||
bt->state = BT_INITIALISING;
|
||||
}
|
||||
bt->on_state_change();
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO read from Serial1 to read OBD2 data */
|
||||
}
|
||||
Reference in New Issue
Block a user