mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-16 12:41:05 +00:00
update bluetooth driver (made a start)
This commit is contained in:
21
due_obd2/obd2_bt.c
Normal file
21
due_obd2/obd2_bt.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "wiring_digital.h"
|
||||
#include "obd2_bt.h"
|
||||
|
||||
void obd2_bt_init(obd2_bt_t *bt)
|
||||
{
|
||||
bt->state = BT_INITIALISING;
|
||||
}
|
||||
|
||||
void obd2_bt_process(obd2_bt_t *bt)
|
||||
{
|
||||
__UINT32_TYPE__ bt_state = digitalRead(BT_STATE_PIN);
|
||||
if (bt_state)
|
||||
{
|
||||
bt->state = BT_CONNECTED;
|
||||
}
|
||||
else
|
||||
{
|
||||
bt->state = BT_INITIALISING;
|
||||
}
|
||||
bt->on_state_change();
|
||||
}
|
||||
Reference in New Issue
Block a user