Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arduino Core for SAMD21 CPU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
Arduino Core for SAMD21 CPU
Commits
1a4e8854
Commit
1a4e8854
authored
10 years ago
by
Cristian Maglie
Committed by
Cristian Maglie
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Merge branch 'ide-1.5.x' into zero
parent
b4bc89c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cores/arduino/Server.h
+6
-3
6 additions, 3 deletions
cores/arduino/Server.h
cores/arduino/WString.cpp
+18
-14
18 additions, 14 deletions
cores/arduino/WString.cpp
variants/arduino_zero/variant.h
+9
-1
9 additions, 1 deletion
variants/arduino_zero/variant.h
with
33 additions
and
18 deletions
cores/arduino/Server.h
+
6
−
3
View file @
1a4e8854
/*
Copyright (c) 2014 Arduino. All right reserved.
Server.h - Base class that provides Server
Copyright (c) 2011 Adrian McEwen. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
...
...
@@ -8,8 +9,8 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU
Lesser General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
...
...
@@ -19,6 +20,8 @@
#ifndef server_h
#define server_h
#include
"Print.h"
class
Server
:
public
Print
{
public:
virtual
void
begin
()
=
0
;
...
...
This diff is collapsed.
Click to expand it.
cores/arduino/WString.cpp
+
18
−
14
View file @
1a4e8854
/*
Copyright (c) 2014 Arduino. All right reserved.
WString.cpp - String library for Wiring & Arduino
...mostly rewritten by Paul Stoffregen...
Copyright (c) 2009-10 Hernando Barragan. All rights reserved.
Copyright 2011, Paul Stoffregen, paul@pjrc.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
...
...
@@ -8,8 +11,8 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU
Lesser General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
...
...
@@ -213,10 +216,10 @@ void String::move(String &rhs)
String
&
String
::
operator
=
(
const
String
&
rhs
)
{
if
(
this
==
&
rhs
)
return
*
this
;
if
(
rhs
.
buffer
)
copy
(
rhs
.
buffer
,
rhs
.
len
);
else
invalidate
();
return
*
this
;
}
...
...
@@ -238,7 +241,7 @@ String & String::operator = (const char *cstr)
{
if
(
cstr
)
copy
(
cstr
,
strlen
(
cstr
));
else
invalidate
();
return
*
this
;
}
...
...
@@ -481,7 +484,7 @@ unsigned char String::equalsIgnoreCase( const String &s2 ) const
const
char
*
p2
=
s2
.
buffer
;
while
(
*
p1
)
{
if
(
tolower
(
*
p1
++
)
!=
tolower
(
*
p2
++
))
return
0
;
}
}
return
1
;
}
...
...
@@ -512,7 +515,7 @@ char String::charAt(unsigned int loc) const
return
operator
[](
loc
);
}
void
String
::
setCharAt
(
unsigned
int
loc
,
char
c
)
void
String
::
setCharAt
(
unsigned
int
loc
,
char
c
)
{
if
(
loc
<
len
)
buffer
[
loc
]
=
c
;
}
...
...
@@ -618,10 +621,10 @@ String String::substring(unsigned int left, unsigned int right) const
left
=
temp
;
}
String
out
;
if
(
left
>
len
)
return
out
;
if
(
left
>
=
len
)
return
out
;
if
(
right
>
len
)
right
=
len
;
char
temp
=
buffer
[
right
];
// save the replaced character
buffer
[
right
]
=
'\0'
;
buffer
[
right
]
=
'\0'
;
out
=
buffer
+
left
;
// pointer arithmetic
buffer
[
right
]
=
temp
;
//restore character
return
out
;
...
...
@@ -683,15 +686,16 @@ void String::replace(const String& find, const String& replace)
}
void
String
::
remove
(
unsigned
int
index
){
if
(
index
>=
len
)
{
return
;
}
int
count
=
len
-
index
;
remove
(
index
,
count
);
// Pass the biggest integer as the count. The remove method
// below will take care of truncating it at the end of the
// string.
remove
(
index
,
(
unsigned
int
)
-
1
);
}
void
String
::
remove
(
unsigned
int
index
,
unsigned
int
count
){
if
(
index
>=
len
)
{
return
;
}
if
(
count
<=
0
)
{
return
;
}
if
(
index
+
count
>
len
)
{
count
=
len
-
index
;
}
if
(
count
>
len
-
index
)
{
count
=
len
-
index
;
}
char
*
writeTo
=
buffer
+
index
;
len
=
len
-
count
;
strncpy
(
writeTo
,
buffer
+
index
+
count
,
len
-
index
);
...
...
This diff is collapsed.
Click to expand it.
variants/arduino_zero/variant.h
+
9
−
1
View file @
1a4e8854
...
...
@@ -57,13 +57,21 @@ extern "C"
#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) )
#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin )
#define digitalPinToTimer(P) ( )
//#define analogInPinToBit(P) ( )
#define portOutputRegister(port) ( &(port->OUT.reg) )
#define portInputRegister(port) ( &(port->IN.reg) )
#define portModeRegister(port) ( &(port->DIR.reg) )
#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER )
/*
* digitalPinToTimer(..) is AVR-specific and is not defined for SAMD
* architecture. If you need to check if a pin supports PWM you must
* use digitalPinHasPWM(..).
*
* https://github.com/arduino/Arduino/issues/1833
*/
// #define digitalPinToTimer(P)
// Interrupts
#define digitalPinToInterrupt(P) ( g_APinDescription[P].ulExtInt )
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment