Skip to content

Commit ba6ac8e

Browse files
committed
zephyrCommon: Add Print::write(uint8_t*, size_t) default implementation
When compile with enabling CONFIG_DEBUG option, the Print::write virtual function failed to link. This implementation is usually not used. Because the override implementation that implements by the subclass will be used. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
1 parent 5a76d45 commit ba6ac8e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cores/arduino/zephyrCommon.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,12 @@ unsigned long micros(void) {
4949

5050
unsigned long millis(void) { return k_uptime_get_32(); }
5151

52+
/* default implementation */
53+
size_t arduino::Print::write(const uint8_t *buffer, size_t size)
54+
{
55+
size_t i;
56+
for (i=0; i<size && write(buffer[i]); i++) {
57+
}
58+
59+
return i;
60+
}

0 commit comments

Comments
 (0)