Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit 2e7a5bf

Browse files
authored
v1.3.1 to update PIO
### Releases v1.3.1 1. Update `platform.ini` and `library.json` to use original `khoih-prog` instead of `khoih.prog` after PIO fix 2. Update `Packages' Patches`
1 parent 60674ea commit 2e7a5bf

File tree

19 files changed

+4046
-0
lines changed

19 files changed

+4046
-0
lines changed

Packages_Patches/adafruit/hardware/nrf52/0.22.1/cores/nRF5/Print.cpp

+420
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
Copyright (c) 2016 Arduino LLC. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#pragma once
20+
21+
#include <inttypes.h>
22+
#include <stdio.h> // for size_t
23+
24+
#include "WString.h"
25+
#include "Printable.h"
26+
27+
#define DEC 10
28+
#define HEX 16
29+
#define OCT 8
30+
#define BIN 2
31+
32+
class Print
33+
{
34+
private:
35+
int write_error;
36+
size_t printNumber(unsigned long, uint8_t);
37+
size_t printULLNumber(unsigned long long, uint8_t);
38+
size_t printFloat(double, int);
39+
protected:
40+
void setWriteError(int err = 1) { write_error = err; }
41+
public:
42+
Print() : write_error(0) {}
43+
44+
int getWriteError() { return write_error; }
45+
void clearWriteError() { setWriteError(0); }
46+
47+
virtual size_t write(uint8_t) = 0;
48+
size_t write(const char *str) {
49+
if (str == NULL) return 0;
50+
return write((const uint8_t *)str, strlen(str));
51+
}
52+
virtual size_t write(const uint8_t *buffer, size_t size);
53+
size_t write(const char *buffer, size_t size) {
54+
return write((const uint8_t *)buffer, size);
55+
}
56+
57+
// default to zero, meaning "a single write may block"
58+
// should be overridden by subclasses with buffering
59+
virtual int availableForWrite() { return 0; }
60+
61+
size_t print(const __FlashStringHelper *);
62+
size_t print(const String &);
63+
size_t print(const char[]);
64+
size_t print(char);
65+
size_t print(unsigned char, int = DEC);
66+
size_t print(int, int = DEC);
67+
size_t print(unsigned int, int = DEC);
68+
size_t print(long, int = DEC);
69+
size_t print(unsigned long, int = DEC);
70+
size_t print(long long, int = DEC);
71+
size_t print(unsigned long long, int = DEC);
72+
size_t print(double, int = 2);
73+
size_t print(const Printable&);
74+
75+
size_t println(const __FlashStringHelper *);
76+
size_t println(const String &s);
77+
size_t println(const char[]);
78+
size_t println(char);
79+
size_t println(unsigned char, int = DEC);
80+
size_t println(int, int = DEC);
81+
size_t println(unsigned int, int = DEC);
82+
size_t println(long, int = DEC);
83+
size_t println(unsigned long, int = DEC);
84+
size_t println(long long, int = DEC);
85+
size_t println(unsigned long long, int = DEC);
86+
size_t println(double, int = 2);
87+
size_t println(const Printable&);
88+
size_t println(void);
89+
90+
size_t printf(const char * format, ...);
91+
92+
size_t printBuffer(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
93+
size_t printBuffer(char const buffer[], int size, char delim=' ', int byteline = 0)
94+
{
95+
return printBuffer((uint8_t const*) buffer, size, delim, byteline);
96+
}
97+
98+
size_t printBufferReverse(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
99+
size_t printBufferReverse(char const buffer[], int size, char delim=' ', int byteline = 0)
100+
{
101+
return printBufferReverse((uint8_t const*) buffer, size, delim, byteline);
102+
}
103+
104+
virtual void flush() { /* Empty implementation for backward compatibility */ }
105+
};
106+
107+

0 commit comments

Comments
 (0)