Merge branch 'master' into master
This commit is contained in:
commit
22dfda2c1c
11 changed files with 18 additions and 11 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit ece6e68f29c6f406a4434659bcbcfe558baaa3a9
|
Subproject commit 82928635c893189343cf8eb78569f0c4136fded0
|
||||||
|
|
@ -110,7 +110,7 @@ extern bool __isFreeRTOS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PGM_VOID_P
|
#ifndef PGM_VOID_P
|
||||||
#define PGM_VOID_P void *
|
#define PGM_VOID_P const void *
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
@ -159,3 +159,7 @@ constexpr uint64_t __bitset(const int (&a)[N], size_t i = 0U) {
|
||||||
#define __GPIOCNT 30
|
#define __GPIOCNT 30
|
||||||
#define __FIRSTANALOGGPIO 26
|
#define __FIRSTANALOGGPIO 26
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
using namespace arduino;
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
extern "C" typedef struct uart_inst uart_inst_t;
|
extern "C" typedef struct uart_inst uart_inst_t;
|
||||||
|
|
||||||
class SerialPIO : public HardwareSerial {
|
class SerialPIO : public arduino::HardwareSerial {
|
||||||
public:
|
public:
|
||||||
static const pin_size_t NOPIN = 0xff; // Use in constructor to disable RX or TX unit
|
static const pin_size_t NOPIN = 0xff; // Use in constructor to disable RX or TX unit
|
||||||
SerialPIO(pin_size_t tx, pin_size_t rx, size_t fifoSize = 32);
|
SerialPIO(pin_size_t tx, pin_size_t rx, size_t fifoSize = 32);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#include "api/HardwareSerial.h"
|
#include "api/HardwareSerial.h"
|
||||||
|
|
||||||
class SerialSemiClass : public HardwareSerial {
|
class SerialSemiClass : public arduino::HardwareSerial {
|
||||||
public:
|
public:
|
||||||
SerialSemiClass() {
|
SerialSemiClass() {
|
||||||
/* noop */
|
/* noop */
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
extern "C" typedef struct uart_inst uart_inst_t;
|
extern "C" typedef struct uart_inst uart_inst_t;
|
||||||
|
|
||||||
#define UART_PIN_NOT_DEFINED (255u)
|
#define UART_PIN_NOT_DEFINED (255u)
|
||||||
class SerialUART : public HardwareSerial {
|
class SerialUART : public arduino::HardwareSerial {
|
||||||
public:
|
public:
|
||||||
SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx, pin_size_t rts = UART_PIN_NOT_DEFINED, pin_size_t cts = UART_PIN_NOT_DEFINED);
|
SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx, pin_size_t rts = UART_PIN_NOT_DEFINED, pin_size_t cts = UART_PIN_NOT_DEFINED);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#include "api/HardwareSerial.h"
|
#include "api/HardwareSerial.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
class SerialUSB : public HardwareSerial {
|
class SerialUSB : public arduino::HardwareSerial {
|
||||||
public:
|
public:
|
||||||
SerialUSB() { }
|
SerialUSB() { }
|
||||||
void begin(unsigned long baud = 115200) override;
|
void begin(unsigned long baud = 115200) override;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <_syslist.h>
|
#include <_syslist.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
|
#include <sys/unistd.h>
|
||||||
#include <pico/stdlib.h>
|
#include <pico/stdlib.h>
|
||||||
#include <pico/multicore.h>
|
#include <pico/multicore.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@ extern "C" void shiftOut(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOr
|
||||||
}
|
}
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
if (bitOrder == LSBFIRST) {
|
if (bitOrder == LSBFIRST) {
|
||||||
digitalWrite(dataPin, !!(val & (1 << i)));
|
digitalWrite(dataPin, !!(val & (1 << i)) ? HIGH : LOW);
|
||||||
} else {
|
} else {
|
||||||
digitalWrite(dataPin, !!(val & (1 << (7 - i))));
|
digitalWrite(dataPin, !!(val & (1 << (7 - i))) ? HIGH : LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
digitalWrite(clockPin, HIGH);
|
digitalWrite(clockPin, HIGH);
|
||||||
|
|
|
||||||
|
|
@ -216,9 +216,9 @@ void handleFileList() {
|
||||||
// as an HTTP chunk
|
// as an HTTP chunk
|
||||||
Serial.println(output);
|
Serial.println(output);
|
||||||
server.sendContent(output);
|
server.sendContent(output);
|
||||||
output = ',';
|
output = ",";
|
||||||
} else {
|
} else {
|
||||||
output = '[';
|
output = "[";
|
||||||
}
|
}
|
||||||
|
|
||||||
output += "{\"type\":\"";
|
output += "{\"type\":\"";
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
#include <Udp.h>
|
#include <Udp.h>
|
||||||
#include <include/slist.h>
|
#include <include/slist.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -507,7 +507,7 @@ bool TwoWire::writeReadAsync(uint8_t address, const void *wbuffer, size_t wbytes
|
||||||
abortAsync();
|
abortAsync();
|
||||||
|
|
||||||
// Create or enlarge dma command buffer, we need one entry for every i2c byte we want to write/read
|
// Create or enlarge dma command buffer, we need one entry for every i2c byte we want to write/read
|
||||||
const size_t bufLen = (wbytes + rbytes) * 2;
|
const size_t bufLen = (wbytes + rbytes) * sizeof(uint16_t);
|
||||||
if (_dmaSendBufferLen < bufLen) {
|
if (_dmaSendBufferLen < bufLen) {
|
||||||
if (_dmaSendBuffer) {
|
if (_dmaSendBuffer) {
|
||||||
free(_dmaSendBuffer);
|
free(_dmaSendBuffer);
|
||||||
|
|
@ -518,6 +518,7 @@ bool TwoWire::writeReadAsync(uint8_t address, const void *wbuffer, size_t wbytes
|
||||||
if (!_dmaSendBuffer) {
|
if (!_dmaSendBuffer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
_dmaSendBufferLen = bufLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill the dma command buffer
|
// Fill the dma command buffer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue