123
Diff: sx127x.cpp
- Revision:
- 27:da6341d9d5b1
- Parent:
- 25:fa867fb9d2f6
- Child:
- 29:b72ac28d59e9
--- a/sx127x.cpp Mon Jul 18 21:13:50 2016 +0000 +++ b/sx127x.cpp Thu Jul 28 00:57:22 2016 +0000 @@ -222,7 +222,7 @@ { uint32_t frf; - frf = MHz / FREQ_STEP_MHZ; + frf = MHz / (float)FREQ_STEP_MHZ; write_u24(REG_FRFMSB, frf); if (MHz < 525) @@ -258,11 +258,15 @@ void SX127x::hw_reset() { - /* only a french-swiss design would have hi-Z deassert */ + int in = reset_pin.read(); reset_pin.output(); reset_pin.write(1); - wait(0.05); + wait(0.05); + if (in == 1) { /* pin is pulled up somewhere? */ + reset_pin.write(0); + wait(0.005); + } reset_pin.input(); - wait(0.05); + wait(0.005); }