Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit829215a

Browse files
authored
Merge branch 'arduino:master' into Feat/more-string-functions
2 parents66ea405 +65633ce commit829215a

File tree

87 files changed

+287
-113
lines changed

Some content is hidden

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

87 files changed

+287
-113
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name:API deprecation
3+
about:Suggest the deprecation of an API component defined by ArduinoCore-API.
4+
title:""
5+
labels:enhancement
6+
assignees:""
7+
---
8+
9+
###API component
10+
11+
<!-- Tell us which API component the deprecation applies to.-->
12+
13+
###Description
14+
15+
<!-- A clear and concise description of the suggestion.-->
16+
<!-- What is the reason for the deprecation?-->
17+
18+
###Replacement API component
19+
20+
<!-- What should be used instead of the deprecated API component?-->
21+
<!-- Is this replacement available to all users (e.g., is it provided by the C++ standard version used in major boards platforms)?-->
22+
23+
###Additional information
24+
25+
<!-- Add any other context for the suggestion here.-->
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name:API improvement
3+
about:Suggest an improvement to an existing API component.
4+
title:""
5+
labels:enhancement
6+
assignees:""
7+
---
8+
9+
###API component
10+
11+
<!-- Tell us which API component the improvement applies to.-->
12+
13+
###Description
14+
15+
<!-- A clear and concise description of the suggestion.-->
16+
17+
###Is this a breaking change?
18+
19+
<!-- Would this change require any users to change their code?-->
20+
<!-- Would this change require any boards platform authors to change their configuration files or release system?-->
21+
22+
###Additional information
23+
24+
<!-- Add any other context for the request here.-->
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name:Bug report
3+
about:Report problems with the code in this repository.
4+
title:""
5+
labels:bug
6+
assignees:""
7+
---
8+
9+
###Description
10+
11+
<!-- A clear and concise description of the bug.-->
12+
13+
###Environment
14+
15+
- Boards platform name:
16+
- Boards platform version (as shown in Boards Manager):
17+
- ArduinoCore-API version (if you manually installed it):
18+
19+
###Current behavior
20+
21+
<!-- Provide a minimal sketch that demonstrates the issue.-->
22+
23+
###Expected behavior
24+
25+
<!-- Describe what you expect to happen when the demonstration sketch is run.-->
26+
27+
###Additional information
28+
29+
<!-- Add any other context about the problem here.-->

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
contact_links:
2+
-name:Learn about the Arduino language
3+
url:https://www.arduino.cc/reference/en
4+
about:User documentation is available at the Arduino language reference.
5+
-name:Support request
6+
url:https://forum.arduino.cc/
7+
about:We can help you out on the Arduino Forum!
8+
-name:Discuss ArduinoCore-API development
9+
url:https://groups.google.com/a/arduino.cc/g/developers
10+
about:Arduino Developers Mailing List
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name:New API component
3+
about:Suggest the addition of a new API component to ArduinoCore-API.
4+
title:""
5+
labels:enhancement
6+
assignees:""
7+
---
8+
9+
###Description
10+
11+
<!-- A clear and concise description of the API component you want added.-->
12+
13+
###Additional information
14+
15+
<!-- Add any other context for the request here.-->
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name:Other enhancement
3+
about:
4+
Suggest an improvement for this project that doesn't fit in the specific categories
5+
above.
6+
title:""
7+
labels:enhancement
8+
assignees:""
9+
---
10+
11+
###Description
12+
13+
<!-- A clear and concise description of the enhancement.-->
14+
15+
###Is this a breaking change?
16+
17+
<!-- Would this change require any users to change their code?-->
18+
<!-- Would this change require any boards platform authors to change their configuration files or release system?-->
19+
20+
###Additional information
21+
22+
<!-- Add any other context for the request here.-->

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ As of now, the following official cores are utilising ArduinoCore-API:
1313
*[megaavr](https://github.com/arduino/ArduinoCore-megaAVR)
1414
*[mbed](https://github.com/arduino/ArduinoCore-mbed)
1515
*[samd](https://github.com/arduino/ArduinoCore-samd)
16+
*[renesas](https://github.com/arduino/ArduinoCore-renesas)
1617

1718
There's an ongoing effort to port the others, while maintainers of third-party cores are strongly invited to follow the same route in order to stay up-to-date with the new language features. For backwards compatibility, every revision of this repo will increase the`ARDUINO_API_VERSION` define.
1819

@@ -77,6 +78,8 @@ In order to compile a core which is implementing ArduinoCore-API you'll need to
7778
tar --exclude='*.git*' -cjhvf$yourcore-$version.tar.bz2$yourcore/
7879
```
7980

81+
The API is coded to the C++11 standard and the core's compiler must be able to support that version of the language.
82+
8083
Documentation for how to integrate with a Arduino core (which is necessary if you do not download the Arduino core via the Boards Manager) can be found here:
8184
*[ArduinoCore-megaavr](https://github.com/arduino/ArduinoCore-megaavr#developing)
8285
*[ArduinoCore-mbed](https://github.com/arduino/ArduinoCore-mbed#clone-the-repository-in-sketchbookhardwarearduino-git)

‎api/CanMsg.h‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class CanMsg : public Printable
4545
, data_length{min(can_data_len, MAX_DATA_LENGTH)}
4646
, data{0}
4747
{
48-
memcpy(data, can_data_ptr, data_length);
48+
if (data_length && can_data_ptr)
49+
memcpy(data, can_data_ptr, data_length);
4950
}
5051

5152
CanMsg() : CanMsg(0,0,nullptr) { }
@@ -54,7 +55,8 @@ class CanMsg : public Printable
5455
{
5556
this->id = other.id;
5657
this->data_length = other.data_length;
57-
memcpy(this->data, other.data,this->data_length);
58+
if (this->data_length && other.data)
59+
memcpy(this->data, other.data,this->data_length);
5860
}
5961

6062
virtual~CanMsg() { }
@@ -65,7 +67,8 @@ class CanMsg : public Printable
6567
{
6668
this->id = other.id;
6769
this->data_length = other.data_length;
68-
memcpy(this->data, other.data,this->data_length);
70+
if (this->data_length && other.data)
71+
memcpy(this->data, other.data,this->data_length);
6972
}
7073
return (*this);
7174
}

‎api/CanMsgRingbuffer.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void CanMsgRingbuffer::enqueue(CanMsg const & msg)
4040

4141
_buf[_head] = msg;
4242
_head =next(_head);
43-
_num_elems++;
43+
_num_elems = _num_elems +1;
4444
}
4545

4646
CanMsgCanMsgRingbuffer::dequeue()
@@ -50,7 +50,7 @@ CanMsg CanMsgRingbuffer::dequeue()
5050

5151
CanMsgconst msg = _buf[_tail];
5252
_tail =next(_tail);
53-
_num_elems--;
53+
_num_elems = _num_elems -1;
5454

5555
return msg;
5656
}

‎api/IPAddress.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ IPAddress::IPAddress(const char *address)
9797
StringIPAddress::toString4()const
9898
{
9999
char szRet[16];
100-
sprintf(szRet,"%u.%u.%u.%u", _address.bytes[IPADDRESS_V4_BYTES_INDEX], _address.bytes[IPADDRESS_V4_BYTES_INDEX +1], _address.bytes[IPADDRESS_V4_BYTES_INDEX +2], _address.bytes[IPADDRESS_V4_BYTES_INDEX +3]);
100+
snprintf(szRet,sizeof(szRet),"%u.%u.%u.%u", _address.bytes[IPADDRESS_V4_BYTES_INDEX], _address.bytes[IPADDRESS_V4_BYTES_INDEX +1], _address.bytes[IPADDRESS_V4_BYTES_INDEX +2], _address.bytes[IPADDRESS_V4_BYTES_INDEX +3]);
101101
returnString(szRet);
102102
}
103103

104104
StringIPAddress::toString6()const
105105
{
106106
char szRet[40];
107-
sprintf(szRet,"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
107+
snprintf(szRet,sizeof(szRet),"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
108108
_address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3],
109109
_address.bytes[4], _address.bytes[5], _address.bytes[6], _address.bytes[7],
110110
_address.bytes[8], _address.bytes[9], _address.bytes[10], _address.bytes[11],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp