pull/799/head
Kevin Hester 2021-04-22 14:28:56 +08:00
rodzic 6e27856daa
commit 8e3281a658
4 zmienionych plików z 34 dodań i 21 usunięć

Wyświetl plik

@ -14,16 +14,9 @@
</component>
<component name="ChangeListManager">
<list default="true" id="58922733-b05b-4b90-9655-b9b18914977a" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/geeksville-private/pine64.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.vscode/settings.json" beforeDir="false" afterPath="$PROJECT_DIR$/.vscode/settings.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/geeksville-private/TODO.md" beforeDir="false" afterPath="$PROJECT_DIR$/geeksville-private/TODO.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/platformio.ini" beforeDir="false" afterPath="$PROJECT_DIR$/platformio.ini" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/configuration.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/configuration.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/mesh/RF95Interface.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/mesh/RF95Interface.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/mesh/RadioInterface.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/mesh/RadioInterface.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/mesh/SX1262Interface.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/mesh/SX1262Interface.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/portduino/PortduinoGlue.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/portduino/PortduinoGlue.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -69,9 +62,9 @@
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration default="true" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" PASS_PARENT_ENVS_2="true">
<configuration default="true" type="GradleAppRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" PASS_PARENT_ENVS_2="true">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
<option name="com.jetbrains.cidr.cpp.gradle.execution.GradleNativeBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration name="PlatformIO Debug" type="platformio" factoryName="PlatformIO Debug" REDIRECT_INPUT="false" ELEVATE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="meshtastic-esp32" TARGET_NAME="Debug" CONFIG_NAME="native" RUN_TARGET_PROJECT_NAME="meshtastic-esp32" RUN_TARGET_NAME="Debug">
@ -111,6 +104,7 @@
<workItem from="1617437366919" duration="1182000" />
<workItem from="1618544034975" duration="1185000" />
<workItem from="1618624455224" duration="860000" />
<workItem from="1619062544208" duration="2347000" />
</task>
<servers />
</component>
@ -158,9 +152,19 @@
<option name="timeStamp" value="12" />
</line-breakpoint>
<line-breakpoint enabled="true" type="com.jetbrains.cidr.execution.debugger.OCBreakpointType">
<url>file://$USER_HOME$/.platformio/packages/framework-portduino/cores/portduino/PortduinoGPIO.cpp</url>
<line>41</line>
<option name="timeStamp" value="13" />
<url>file://$PROJECT_DIR$/.pio/libdeps/native/RadioLib/src/modules/SX126x/SX126x.cpp</url>
<line>27</line>
<option name="timeStamp" value="15" />
</line-breakpoint>
<line-breakpoint enabled="true" type="com.jetbrains.cidr.execution.debugger.OCBreakpointType">
<url>file://$PROJECT_DIR$/.pio/libdeps/native/RadioLib/src/modules/SX126x/SX126x.cpp</url>
<line>168</line>
<option name="timeStamp" value="16" />
</line-breakpoint>
<line-breakpoint enabled="true" type="com.jetbrains.cidr.execution.debugger.OCBreakpointType">
<url>file://$PROJECT_DIR$/.pio/libdeps/native/RadioLib/src/modules/SX126x/SX126x.cpp</url>
<line>1537</line>
<option name="timeStamp" value="17" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>

Wyświetl plik

@ -72,7 +72,7 @@ lib_deps =
1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib
https://github.com/meshtastic/arduino-fsm.git#829e967b8a95c094f73c60ef8dacfe66eae38940
https://github.com/meshtastic/SparkFun_Ublox_Arduino_Library.git#31015a55e630a2df77d9d714669c621a5bf355ad
https://github.com/meshtastic/RadioLib.git#07de964e929238949035fb0d5887026a3058df1a
https://github.com/meshtastic/RadioLib.git#242bfade03b31556eedf0bb88ea83c2562ce96f8
https://github.com/meshtastic/TinyGPSPlus.git#f0f47067ef2f67c856475933188251c1ef615e79
https://github.com/meshtastic/AXP202X_Library.git#8404abb6d4b486748636bc6ad72d2a47baaf5460
Wire ; explicitly needed here because the AXP202 library forgets to add it
@ -417,7 +417,7 @@ lib_deps =
[env:native]
platform = https://github.com/geeksville/platform-native.git
src_filter = ${env.src_filter} -<esp32/> -<nimble/> -<nrf52/> -<mesh/http/> -<plugins/esp32>
build_flags = ${arduino_base.build_flags} -O0
build_flags = ${arduino_base.build_flags} -O0 -lgpiod
framework = arduino
board = native
lib_deps =

Wyświetl plik

@ -424,8 +424,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define USE_SIM_RADIO
// Pine64 uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
// not found then probe for SX1262
#define USE_RF95
// not found then probe for SX1262. Currently the RF95 code is disabled because I think the RF95 module won't need to ship.
// #define USE_RF95
#define USE_SX1262
// Fake SPI device selections
@ -436,12 +436,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET RADIOLIB_NC
#define LORA_DIO1 33 // SX1262 IRQ - FIXME, attach to gpio4/IRQ with linux spidev
#define LORA_DIO2 32 // SX1262 BUSY - FIXME, misassigned in schematic?
#define LORA_DIO1 33 // SX1262 IRQ, called DIO0 on pinelora schematic, pin 7 on ch341f "ack" - FIXME, enable hwints in linux
#define LORA_DIO2 32 // SX1262 BUSY, actually connected to "DIO5" on pinelora schematic, pin 8 on ch341f "slct"
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
#ifdef USE_SX1262
#define SX1262_CS 20 // FIXME - we need to assign a pinetab CS GPIO binding (so host can manually control it wrt BUSY)
#define SX1262_CS 20 // CS0 on pinelora schematic, hooked to gpio D0 on ch341f
#define SX1262_DIO1 LORA_DIO1
#define SX1262_BUSY LORA_DIO2
#define SX1262_RESET LORA_RESET

Wyświetl plik

@ -6,6 +6,7 @@
#include <Utility.h>
#include <assert.h>
#include <linux/gpio/LinuxGPIOPin.h>
// FIXME - move setBluetoothEnable into a HALPlatform class
@ -44,10 +45,10 @@ void updateBatteryLevel(uint8_t level) NOT_IMPLEMENTED("updateBatteryLevel");
*
* Porduino helper class to do this i2c based polling:
*/
class PolledIrqPin : public GPIOPin
class PolledIrqPin : public LinuxGPIOPin
{
public:
PolledIrqPin() : GPIOPin(LORA_DIO0, "LORA_DIO0") {}
PolledIrqPin() : LinuxGPIOPin(LORA_DIO1, "ch341", "int", "loraIrq") {}
/// Read the low level hardware for this pin
virtual PinStatus readPinHardware()
@ -77,6 +78,14 @@ void portduinoSetup()
// FIXME: remove this hack once interrupts are confirmed to work on new pine64 board
gpioBind(new PolledIrqPin());
// BUSY hw is busted on current board - just use the simulated pin (which will read low)
// gpioBind(new LinuxGPIOPin(SX1262_BUSY, "ch341", "slct", "loraBusy"));
auto fakeBusy = new SimGPIOPin(SX1262_BUSY, "fakeBusy");
fakeBusy->writePin(LOW);
gpioBind(fakeBusy);
gpioBind(new LinuxGPIOPin(SX1262_CS, "ch341", "cs0", "loraCs"));
// gpioBind((new SimGPIOPin(LORA_RESET, "LORA_RESET")));
// gpioBind((new SimGPIOPin(RF95_NSS, "RF95_NSS"))->setSilent());
}