Skip to content

Commit 65508a6

Browse files
Arduino Zero sync, general cleanup, add new clocking scheme for HCLK/APB1CLK/APB2CLK
1 parent c97ea3c commit 65508a6

File tree

156 files changed

+377
-6384
lines changed

Some content is hidden

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

156 files changed

+377
-6384
lines changed

cores/stm32l4/WInterrupts.c

Lines changed: 0 additions & 59 deletions
This file was deleted.

cores/stm32l4/WInterrupts.h

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/*
2-
stdlib_noniso.h - nonstandard (but usefull) conversion functions
1+
/*
2+
dtostrf - Emulation for dtostrf function from avr-libc
3+
Copyright (c) 2015 Arduino LLC. All rights reserved.
34
4-
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
5-
This file is part of the esp8266 core for Arduino environment.
6-
75
This library is free software; you can redistribute it and/or
86
modify it under the terms of the GNU Lesser General Public
97
License as published by the Free Software Foundation; either
@@ -19,32 +17,14 @@
1917
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2018
*/
2119

22-
#ifndef STDLIB_NONISO_H
23-
#define STDLIB_NONISO_H
20+
#include <stdio.h>
2421

25-
#ifdef __cplusplus
26-
extern "C"{
27-
#endif
22+
char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
23+
asm(".global _printf_float");
2824

29-
int atoi(const char *s);
25+
char fmt[20];
26+
sprintf(fmt, "%%%d.%df", width, prec);
27+
sprintf(sout, fmt, val);
28+
return sout;
29+
}
3030

31-
long atol(const char* s);
32-
33-
double atof(const char* s);
34-
35-
char* itoa (int val, char *s, int radix);
36-
37-
char* ltoa (long val, char *s, int radix);
38-
39-
char* utoa (unsigned int val, char *s, int radix);
40-
41-
char* ultoa (unsigned long val, char *s, int radix);
42-
43-
char* dtostrf (double val, signed char width, unsigned char prec, char *s);
44-
45-
#ifdef __cplusplus
46-
} // extern "C"
47-
#endif
48-
49-
50-
#endif

cores/stm32l4/Reset.cpp renamed to cores/stm32l4/avr/dtostrf.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Copyright (c) 2015 Arduino LLC. All right reserved.
2+
dtostrf - Emulation for dtostrf function from avr-libc
3+
Copyright (c) 2015 Arduino LLC. All rights reserved.
34
45
This library is free software; you can redistribute it and/or
56
modify it under the terms of the GNU Lesser General Public
@@ -8,30 +9,21 @@
89
910
This library is distributed in the hope that it will be useful,
1011
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.
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
1314
1415
You should have received a copy of the GNU Lesser General Public
1516
License along with this library; if not, write to the Free Software
1617
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1718
*/
1819

19-
#include <Arduino.h>
20-
#include "Reset.h"
21-
22-
#include "wiring_private.h"
20+
#pragma once
2321

2422
#ifdef __cplusplus
2523
extern "C" {
2624
#endif
2725

28-
void initiateReset(int _ticks) {
29-
armv7m_systick_timeout(stm32l4_system_bootloader, _ticks);
30-
}
31-
32-
void cancelReset() {
33-
armv7m_systick_timeout(NULL, 0);
34-
}
26+
char *dtostrf(double val, signed char width, unsigned char prec, char *sout);
3527

3628
#ifdef __cplusplus
3729
}

cores/stm32l4/avr/fdevopen.c

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright (c) 2016 Thomas Roell. All rights reserved.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to
6+
* deal with the Software without restriction, including without limitation the
7+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8+
* sell copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimers.
13+
* 2. Redistributions in binary form must reproduce the above copyright
14+
* notice, this list of conditions and the following disclaimers in the
15+
* documentation and/or other materials provided with the distribution.
16+
* 3. Neither the name of Thomas Roell, nor the names of its contributors
17+
* may be used to endorse or promote products derived from this Software
18+
* without specific prior written permission.
19+
*
20+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
* CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26+
* WITH THE SOFTWARE.
27+
*/
28+
29+
#include <stdbool.h>
30+
#include <stdint.h>
31+
#include <stdlib.h>
32+
#include <string.h>
33+
#include <stdio.h>
34+
35+
extern int (*stm32l4_stdio_put)(char, FILE*);
36+
extern int (*stm32l4_stdio_get)(FILE*);
37+
38+
FILE * fdevopen(int(*put)(char, FILE *), int(*get)(FILE *))
39+
{
40+
if (put != NULL)
41+
{
42+
stm32l4_stdio_put = (void*)put;
43+
44+
return stdout;
45+
}
46+
47+
if (get != NULL)
48+
{
49+
stm32l4_stdio_get = get;
50+
51+
return stdin;
52+
}
53+
54+
return NULL;
55+
}

0 commit comments

Comments
 (0)