File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed
examples/MKRWANFWUpdate_standalone Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ void setup() {
3535 };
3636
3737 port.flags = PORT_CMD_INIT | PORT_GVR_ETX | PORT_BYTE | PORT_RETRY;
38- port.dev = &Serial2 ;
38+ port.dev = &SerialLoRa ;
3939 port.ops = &port_opts;
4040
4141 assignCallbacks (&port);
@@ -53,7 +53,7 @@ void setup() {
5353
5454 Serial.println (" Press a key to start FW update" );
5555 port.open (&port);
56- port.flush (&port);
56+ // port.flush(&port);
5757
5858 stm = stm32_init (&port, 1 );
5959
@@ -267,8 +267,8 @@ again:
267267
268268void resetModuleRunning () {
269269 digitalWrite (LORA_BOOT0, LOW);
270- Serial2 .end ();
271- Serial2 .begin (19200 );
270+ SerialLoRa .end ();
271+ SerialLoRa .begin (19200 );
272272 delay (100 );
273273 digitalWrite (LORA_RESET, HIGH);
274274 delay (100 );
@@ -282,6 +282,7 @@ void loop() {
282282 // put your main code here, to run repeatedly:
283283 if (ret == 0 ) {
284284 Serial.println (" Flashing ok :)" );
285+ SerialLoRa.end ();
285286 LoRaModem* modem = new LoRaModem ();
286287 modem->begin (EU868);
287288 Serial.println (modem->version ());
Original file line number Diff line number Diff line change 11#ifndef _H_PORT
22#define _H_PORT
33
4- #include "Uart.h"
54#include "Arduino.h"
65
76#define usleep (x ) delayMicroseconds(x)
87
8+ #ifndef __MBED__
9+ #include "Uart.h"
10+ #define UART Uart
11+ #endif
912
1013#define fprintf (output , ...) { \
1114 do { \
@@ -56,7 +59,7 @@ struct port_interface {
5659 port_err_t (* read )(struct port_interface * port , void * buf , size_t nbyte );
5760 port_err_t (* write )(struct port_interface * port , void * buf , size_t nbyte );
5861 struct varlen_cmd * cmd_get_reply = NULL;
59- Uart * dev ;
62+ UART * dev ;
6063 struct port_options * ops ;
6164};
6265
Original file line number Diff line number Diff line change 2323#include < stdio.h>
2424#include < string.h>
2525#include < time.h>
26- #include < unistd.h>
2726
2827#include " stm32.h"
2928#include " serial_arduino.h"
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ class SerialFifo
164164};
165165
166166#ifndef YIELD
167- #define YIELD () { delay (0 ); }
167+ #define YIELD () { delay (2 ); }
168168#endif
169169
170170typedef const char * ConstStr;
You can’t perform that action at this time.
0 commit comments