Skip to content

Commit fcce42b

Browse files
authored
Release tag SPRESENSE_ADN_SDK_1.0.001 (#2)
SPRESENSE_ADN_SDK_1.0.001 release. Fixed Issues: Commits: e89e529 Remove #ifdef __cplusplus 3286384 Support install dsp to SD card 894ce91 Extend audio library buffer size 70c0f17 Add bit-length parameter to initialize APIs 34ffa7d Add EEPROM library 22a10ef Fix a compile error that yield() not declared 2c5c3fb Add _BV() macro function 5635c76 Support long long print on Serial library 6e72fdf Fix pgmspace.h may be a compile error 3a2255c Add SPI_CLOCK_DIVn definitions 9602a4b Add reset for memory utils at transit to ReadyMode 5de88c6 Add doxygen comments to SDHCI library 2343e49 Fix SDHCI library 9a5f99b Remove sdhci_api example c339484 Add doxygen comments to sdhci_api example 2fa39e8 Add doxygen comments to read_write example 92b5786 Add SDHCI examples 84bddcf Fix warnings in Camera example 1e887e5 Add doxygen comments to Software Serial library
1 parent 4838119 commit fcce42b

File tree

53 files changed

+1978
-336
lines changed

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

+1978
-336
lines changed

Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/cores/spresense/Arduino.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ unsigned long clockCyclesPerMicrosecond(void);
128128
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
129129
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
130130
#define bit(b) (1UL << (b))
131+
//macro added for compatibility
132+
#ifndef _BV
133+
#define _BV(bit) (1 << (bit))
134+
#endif
135+
#ifndef cbi
136+
#define cbi(reg, bit) (*(reg) &= ~_BV(bit))
137+
#endif
138+
#ifndef sbi
139+
#define sbi(reg, bit) (*(reg) |= _BV(bit))
140+
#endif
131141

132142
/* Interrupts */
133143
void interrupts(void);
@@ -140,6 +150,7 @@ int atexit(void (*func)());
140150
void setup(void);
141151
void loop(void);
142152
long map(long x, long in_min, long in_max, long out_min, long out_max);
153+
void yield(void);
143154

144155
#ifdef __cplusplus
145156
} // extern "C"

Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/cores/spresense/Print.cpp

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,62 @@ size_t Print::printFloat(double number, uint8_t digits)
258258

259259
return n;
260260
}
261+
262+
#ifdef SUPPORT_LONGLONG
263+
264+
size_t Print::println(long long num, int base)
265+
{
266+
size_t n = print(num, base);
267+
n += println();
268+
return n;
269+
}
270+
271+
size_t Print::print(long long num, int base)
272+
{
273+
size_t n = 0;
274+
if (num < 0)
275+
{
276+
n += print((char)'-');
277+
num = -num;
278+
}
279+
if (base < 2) base = 2;
280+
n += print((uint64_t)num, base);
281+
return n;
282+
}
283+
284+
size_t Print::println(unsigned long long num, int base)
285+
{
286+
size_t n = print(num, base);
287+
n += println();
288+
return n;
289+
}
290+
291+
size_t Print::print(unsigned long long num, int base)
292+
{
293+
if (base < 2) base = 2;
294+
return printLLNumber(num, base);
295+
}
296+
297+
size_t Print::printLLNumber(unsigned long long num, uint8_t base)
298+
{
299+
size_t n = 0;
300+
unsigned char buf[16 * sizeof(long)];
301+
unsigned int i = 0;
302+
303+
if (num == 0)
304+
{
305+
n += print((char)'0');
306+
return n;
307+
}
308+
309+
while (num > 0)
310+
{
311+
buf[i++] = num % base;
312+
num /= base;
313+
}
314+
315+
for (; i > 0; i--)
316+
n += print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10));
317+
return n;
318+
}
319+
#endif

Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/cores/spresense/Print.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@
3535
#endif
3636
#define BIN 2
3737

38+
// uncomment next line to support printing of 64 bit ints.
39+
#define SUPPORT_LONGLONG
40+
3841
class Print
3942
{
4043
private:
4144
int write_error;
4245
size_t printNumber(unsigned long, uint8_t);
46+
#ifdef SUPPORT_LONGLONG
47+
size_t printLLNumber(uint64_t, uint8_t);
48+
#endif
4349
size_t printFloat(double, uint8_t);
4450
protected:
4551
void setWriteError(int err = 1) { write_error = err; }
@@ -81,6 +87,12 @@ class Print
8187
size_t println(double, int = 2);
8288
size_t println(const Printable&);
8389
size_t println(void);
90+
#ifdef SUPPORT_LONGLONG
91+
size_t println(long long, int = DEC);
92+
size_t print(long long, int = DEC);
93+
size_t println(unsigned long long, int = DEC);
94+
size_t print(unsigned long long, int = DEC);
95+
#endif
8496
};
8597

8698
#endif

Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/cores/spresense/avr/pgmspace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#ifndef __PGMSPACE_H_
2424
#define __PGMSPACE_H_
2525

26+
#include <stdint.h>
27+
2628
#define PROGMEM
2729
#define PGM_P const char *
2830
#define PSTR(str) (str)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
Copyright (c) 2012 Arduino. 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+
/**
20+
* Empty yield() hook.
21+
*
22+
* This function is intended to be used by library writers to build
23+
* libraries or sketches that supports cooperative threads.
24+
*
25+
* Its defined as a weak symbol and it can be redefined to implement a
26+
* real cooperative scheduler.
27+
*/
28+
static void __empty() {
29+
// Empty
30+
}
31+
void yield(void) __attribute__ ((weak, alias("__empty")));
32+
33+
/**
34+
* SysTick hook
35+
*
36+
* This function is called from SysTick handler, before the default
37+
* handler provided by Arduino.
38+
*/
39+
static int __false() {
40+
// Return false
41+
return 0;
42+
}
43+
int sysTickHook(void) __attribute__ ((weak, alias("__false")));
44+
45+
/**
46+
* SVC hook
47+
* PendSV hook
48+
*
49+
* These functions are called from SVC handler, and PensSV handler.
50+
* Default action is halting.
51+
*/
52+
static void __halt() {
53+
// Halts
54+
while (1)
55+
;
56+
}
57+
void svcHook(void) __attribute__ ((weak, alias("__halt")));
58+
void pendSVHook(void) __attribute__ ((weak, alias("__halt")));

0 commit comments

Comments
 (0)