Skip to content

Commit dc977b0

Browse files
Merge branch 'master' into SDFS
2 parents 9a82f00 + 013d01d commit dc977b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1838
-856
lines changed

cores/esp8266/HardwareSerial.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define HardwareSerial_h
2929

3030
#include <inttypes.h>
31+
#include <time.h>
3132
#include "Stream.h"
3233
#include "uart.h"
3334

@@ -167,7 +168,7 @@ class HardwareSerial: public Stream
167168
{
168169
return write((uint8_t) n);
169170
}
170-
size_t write(const uint8_t *buffer, size_t size)
171+
size_t write(const uint8_t *buffer, size_t size) override
171172
{
172173
return uart_write(_uart, (const char*)buffer, size);
173174
}

cores/esp8266/Udp.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
class UDP: public Stream {
4242

4343
public:
44+
virtual ~UDP() {};
4445
virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use
4546
virtual void stop() =0; // Finish with the UDP socket
4647

cores/esp8266/gdb_hooks.c

+10-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@
2525
value is in register, it doesn't hurt to return a bool, so that the
2626
same stub can be used for gdb_present. */
2727

28-
bool ICACHE_RAM_ATTR __gdb_no_op()
28+
static bool ICACHE_RAM_ATTR __gdb_no_op()
2929
{
3030
return false;
3131
}
3232

33-
extern void gdb_init(void) __attribute__ ((weak, alias("__gdb_no_op")));
34-
extern void gdb_do_break(void) __attribute__ ((weak, alias("__gdb_no_op")));
35-
extern bool gdb_present(void) __attribute__ ((weak, alias("__gdb_no_op")));
33+
void gdb_init(void) __attribute__ ((weak, alias("__gdb_no_op")));
34+
void gdb_do_break(void) __attribute__ ((weak, alias("__gdb_no_op")));
35+
bool gdb_present(void) __attribute__ ((weak, alias("__gdb_no_op")));
36+
bool gdbstub_has_putc1_control(void) __attribute__ ((weak, alias("__gdb_no_op")));
37+
void gdbstub_set_putc1_callback(void (*func)(char)) __attribute__ ((weak, alias("__gdb_no_op")));
38+
bool gdbstub_has_uart_isr_control(void) __attribute__ ((weak, alias("__gdb_no_op")));
39+
void gdbstub_set_uart_isr_callback(void (*func)(void*, uint8_t), void* arg) __attribute__ ((weak, alias("__gdb_no_op")));
40+
void gdbstub_write_char(char c) __attribute__ ((weak, alias("__gdb_no_op")));
41+
void gdbstub_write(const char* buf, size_t size) __attribute__ ((weak, alias("__gdb_no_op")));
3642

cores/esp8266/gdb_hooks.h

+65
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,71 @@ void gdb_do_break(void);
5252
*/
5353
bool gdb_present(void);
5454

55+
// If gdbstub has these set true, then we will disable our own
56+
// usage of them, but use gdbstub's callbacks for them instead
57+
/**
58+
* @brief Check if GDB is installing a putc1 callback.
59+
*
60+
* By default, this function returns false. When GDBStub library is linked,
61+
* this function is overriden and returns true.
62+
*
63+
* @return true if GDB is installing a putc1 callback
64+
*/
65+
bool gdbstub_has_putc1_control(void);
66+
67+
/**
68+
* @brief Register a putc1 callback with GDB.
69+
* @param func function GDB will proxy putc1 data to
70+
*
71+
* By default, this function is a no-op. When GDBStub library is linked,
72+
* this function is overriden and sets GDB stub's secondary putc1 callback to
73+
* func. When GDB stub is linked, but a GDB session is not current attached,
74+
* then GDB stub will pass putc1 chars directly to this function.
75+
*/
76+
void gdbstub_set_putc1_callback(void (*func)(char));
77+
78+
/**
79+
* @brief Check if GDB is installing a uart0 isr callback.
80+
*
81+
* By default, this function returns false. When GDBStub library is linked,
82+
* this function is overriden and returns true.
83+
*
84+
* @return true if GDB is installing a uart0 isr callback
85+
*/
86+
bool gdbstub_has_uart_isr_control(void);
87+
88+
/**
89+
* @brief Register a uart0 isr callback with GDB.
90+
* @param func function GDB will proxy uart0 isr data to
91+
*
92+
* By default, this function is a no-op. When GDBStub library is linked,
93+
* this function is overriden and sets GDB stub's secondary uart0 isr callback
94+
* to func. When GDB stub is linked, but a GDB session is not current attached,
95+
* then GDB stub will pass uart0 isr data back to this function.
96+
*/
97+
void gdbstub_set_uart_isr_callback(void (*func)(void*, uint8_t), void* arg);
98+
99+
/**
100+
* @brief Write a character for output to a GDB session on uart0.
101+
* @param c character to write
102+
*
103+
* By default, this function is a no-op. When GDBStub library is linked,
104+
* this function is overriden and writes a char to either the GDB session on
105+
* uart0 or directly to uart0 if not GDB session is attached.
106+
*/
107+
void gdbstub_write_char(char c);
108+
109+
/**
110+
* @brief Write a char buffer for output to a GDB session on uart0.
111+
* @param buf buffer of data to write
112+
* @param size length of buffer
113+
*
114+
* By default, this function is a no-op. When GDBStub library is linked,
115+
* this function is overriden and writes a buffer to either the GDB session on
116+
* uart0 or directly to uart0 if not GDB session is attached.
117+
*/
118+
void gdbstub_write(const char* buf, size_t size);
119+
55120
#ifdef __cplusplus
56121
}
57122
#endif

cores/esp8266/spiffs_api.h

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ class SPIFFSImpl : public FSImpl
179179
return;
180180
}
181181
SPIFFS_unmount(&_fs);
182+
_workBuf.reset(nullptr);
183+
_fdsBuf.reset(nullptr);
184+
_cacheBuf.reset(nullptr);
182185
}
183186

184187
bool format() override

0 commit comments

Comments
 (0)