Skip to content

Commit 3b24c7b

Browse files
authored
Merge branch 'stm32duino:main' into main
2 parents d5df967 + 5a3f412 commit 3b24c7b

File tree

2,076 files changed

+147273
-56551
lines changed

Some content is hidden

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

2,076 files changed

+147273
-56551
lines changed

.github/ISSUE_TEMPLATE/new-variant-request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ assignees: ''
1515
* Where this hardware can be purchased
1616
* ...
1717

18-
**Note that user can add a STM32 based board following this [wiki](https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-(board))**
18+
**Note that user can add a STM32 based board following this [wiki](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Add-a-new-variant-(board))**
1919

2020
Any contribution is welcome, so do not hesitate to submit a PR.
2121

.github/workflows/Cmake.yml

+22-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
pull_request:
1616
paths-ignore:
1717
- .github/**
18-
- '!.github/workflows/Arduino-build.yml'
18+
- '!.github/workflows/Cmake.yml'
1919
- '*.json'
2020
- '**.md'
2121
- keywords.txt
@@ -28,6 +28,26 @@ jobs:
2828
name: Check CMake usage
2929
runs-on: ubuntu-latest
3030

31+
strategy:
32+
matrix:
33+
boardname:
34+
- NUCLEO_F091RC
35+
- NUCLEO_F103RB
36+
- NUCLEO_F207ZG
37+
- NUCLEO_F303RE
38+
- NUCLEO_F411RE
39+
- NUCLEO_F767ZI
40+
- NUCLEO_G0B1RE
41+
- NUCLEO_G474RE
42+
- NUCLEO_H743ZI2
43+
- NUCLEO_L073RZ
44+
- NUCLEO_L152RE
45+
- NUCLEO_L476RG
46+
- NUCLEO_L552ZE_Q
47+
- NUCLEO_U575ZI_Q
48+
- P_NUCLEO_WB55RG
49+
- NUCLEO_WL55JC1
50+
3151
steps:
3252
- name: Checkout
3353
uses: actions/checkout@main
@@ -38,7 +58,7 @@ jobs:
3858
- name: Configure
3959
run: |
4060
mkdir build
41-
cmake -S CI/build/examples/BareMinimum -B ./build -G Ninja
61+
cmake -DBOARDNAME=${{ matrix.boardname }} -S CI/build/examples/BareMinimum -B ./build -G Ninja
4262
4363
- name: Build example
4464
working-directory: '${{ github.workspace }}/build'

CI/build/examples/BareMinimum/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ cmake_minimum_required(VERSION 3.21)
1010
file(REAL_PATH "../../../../" CORE_PATH EXPAND_TILDE)
1111
file(TO_CMAKE_PATH "${CORE_PATH}" CORE_PATH)
1212

13-
set(BOARDNAME "NUCLEO_F103RB")
13+
if(NOT DEFINED BOARDNAME)
14+
MESSAGE(STATUS "BOARDNAME is not defined set it to NUCLEO_F103RB")
15+
set(BOARDNAME "NUCLEO_F103RB")
16+
endif()
1417

1518
list(APPEND CMAKE_MODULE_PATH ${CORE_PATH}/cmake)
1619
set(CMAKE_TOOLCHAIN_FILE toolchain)

CI/update/stm32variant.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@
6161
mcu_refname = ""
6262
mcu_flash = []
6363
mcu_ram = []
64-
legacy_hal = {"CAN": ["F0", "F1", "F2", "F3", "F4", "F7", "L4"], "ETH": ["F4", "F7", "H7"]}
64+
legacy_hal = {
65+
"CAN": ["F0", "F1", "F2", "F3", "F4", "F7", "L4"],
66+
"ETH": ["F4", "F7", "H7"],
67+
}
6568
# Cube information
6669
product_line_dict = {}
6770

@@ -149,7 +152,7 @@ def parse_mcu_file():
149152
global mcu_refname
150153

151154
tim_regex = r"^(TIM\d+)$"
152-
usb_regex = r"^(USB(?!PD|_HOST|_DEVICE).*)$"
155+
usb_regex = r"^(USB(?!PD|_HOST|_DEVICE|X).*)$"
153156
gpiofile = ""
154157
del tim_inst_list[:]
155158
del mcu_ram[:]
@@ -2060,7 +2063,7 @@ def aggregate_dir():
20602063
# Get all mcu_dir
20612064
mcu_dirs = sorted(mcu_family.glob("*/"))
20622065
# Get original directory list of current serie STM32YYxx
2063-
mcu_out_dirs_ori = sorted(out_family_path.glob("*/"))
2066+
mcu_out_dirs_ori = sorted(out_family_path.glob("*/**"))
20642067
mcu_out_dirs_up = []
20652068
# Group mcu directories when only expressions and xml file name are different
20662069
while mcu_dirs:
@@ -2452,7 +2455,7 @@ def manage_repo():
24522455
xml_mcu = parse(str(mcu_file))
24532456
parse_mcu_file()
24542457
# Generate only for one family
2455-
if filtered_family and filtered_family not in mcu_family:
2458+
if filtered_family and filtered_family not in mcu_family or "MP13" in mcu_refname:
24562459
xml_mcu.unlink()
24572460
continue
24582461

CI/update/templates/boards_entry.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file help to add generic board entry.
22
# upload.maximum_size and product_line have to be verified
33
# and changed if needed.
4-
# See: https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-%28board%29
4+
# See: https://github.com/stm32duino/Arduino_Core_STM32/wiki/Add-a-new-variant-%28board%29
55

66
{% for generic in generic_list %}
77
# Generic {{generic.name}}

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ More information about rebasing can be found at the repository of [edX](https://
100100

101101
### 6. Merged!
102102
When your pull request is merged please update the documentation if the changes require it
103-
[Wiki](https://github.com/stm32duino/wiki/wiki)
103+
[Wiki](https://github.com/stm32duino/Arduino_Core_STM32/wiki)

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Arduino core support for STM32 based boards
22
[![forums](https://img.shields.io/badge/join-the%20forums-blue.svg)](https://www.stm32duino.com/)
3-
[![wiki](https://img.shields.io/badge/browse-the%20wiki-orange.svg)](https://github.com/stm32duino/wiki/wiki)
4-
[![STM32 Core Continuous Integration](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/Continuous-Integration.yml/badge.svg?branch=main)](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/Continuous-Integration.yml)
3+
[![wiki](https://img.shields.io/badge/browse-the%20wiki-orange.svg)](https://github.com/stm32duino/Arduino_Core_STM32/wiki)
4+
[![STM32 Core Continuous Integration](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/Arduino-build.yml/badge.svg?branch=main)](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/Arduino-build.yml )
55
[![Arduino lint status](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/arduino-lint.yml)
66
[![codespell](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/CodeSpell.yml/badge.svg)](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/CodeSpell.yml)
77
[![CMake](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/Cmake.yml/badge.svg)](https://github.com/stm32duino/Arduino_Core_STM32/actions/workflows/Cmake.yml)
@@ -16,7 +16,7 @@
1616
* [Getting Started](https://github.com/stm32duino/Arduino_Core_STM32#getting-started)<br>
1717
* [Supported boards](https://github.com/stm32duino/Arduino_Core_STM32#supported-boards)<br>
1818
* [Troubleshooting](https://github.com/stm32duino/Arduino_Core_STM32#troubleshooting)<br>
19-
* [Wiki](https://github.com/stm32duino/wiki/wiki/)
19+
* [Wiki](https://github.com/stm32duino/Arduino_Core_STM32/wiki/)
2020

2121
## Introduction
2222

@@ -41,11 +41,11 @@ https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectron
4141
* Default branch has changed to *main*.
4242
* Since core release 2.0.0 this link has changed.
4343

44-
For full instructions on using the "**Boards Manager**", see the [Getting Started](https://github.com/stm32duino/wiki/wiki/Getting-Started) page.
44+
For full instructions on using the "**Boards Manager**", see the [Getting Started](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Getting-Started) page.
4545

46-
Advanced user can use the repository to benefit from the latest development. See the [Using git repository](https://github.com/stm32duino/wiki/wiki/Using-git-repository) page.
46+
Advanced user can use the repository to benefit from the latest development. See the [Using git repository](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Using-git-repository) page.
4747

48-
User can add a STM32 based board following this [wiki](https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-(board)).
48+
User can add a STM32 based board following this [wiki](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Add-a-new-variant-(board)).
4949

5050
## Supported boards
5151

@@ -391,7 +391,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
391391
| :----: | :-------: | ---- | :-----: | :---- |
392392
| :green_heart: | STM32G030C6<br>STM32G030C8 | Generic Board | *2.2.0* |
393393
| :green_heart: | STM32G030F6<br>STM32G030F6 | Generic Board | *2.2.0* |
394-
| :green_heart: | STM32G030K8 | [Aurora One](https://www.bfy.kr/aurora-one/) | *2.0.0* |
394+
| :green_heart: | STM32G030K8 | Aurora One | *2.0.0* |
395395
| :green_heart: | STM32G071CB | [AGAFIA SG0](https://www.sigmaic.com/store/p7/agafia-sgo.html) | *2.3.0* |
396396
| :green_heart: | STM32G030J6 | Generic Board | *2.4.0* | |
397397
| :green_heart: | STM32G030K6<br>STM32G030K8 | Generic Board | *2.0.0* | |
@@ -527,7 +527,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
527527
| :green_heart: | STM32H750IB<br>STM32H750II | Generic Board | *2.0.0* | |
528528
| :green_heart: | STM32H750IB | [Daisy](https://www.electro-smith.com/daisy/daisy) | *1.9.0* | |
529529
| :green_heart: | STM32H750IB | [Daisy Patch SM](https://www.electro-smith.com/daisy/patch-sm) | *2.2.0* | |
530-
| :green_heart: | STM32H750IB | [Daisy Petal SM](https://www.electro-smith.com) | *2.2.0* | |
530+
| :green_heart: | STM32H750IB | [Daisy Petal SM](https://www.electro-smith.com/daisy/petal-125b-sm) | *2.2.0* | |
531531
| :green_heart: | STM32H750VB | Generic Board | *2.0.0* | |
532532
| :green_heart: | STM32H750VB | [DevEBox H750VBT6](https://github.com/mcauser/MCUDEV_DEVEBOX_H7XX_M) | *2.2.0* | |
533533
| :green_heart: | STM32H750VB | [WeAct MiniSTM32H750VBT6](https://github.com/WeActStudio/MiniSTM32H7xx) | *2.2.0* | [More info](https://github.com/stm32duino/Arduino_Core_STM32/pull/1552) |
@@ -747,7 +747,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
747747
| :----: | :-------: | ---- | :-----: | :---- |
748748
| :green_heart: | STM32L073RZ | [AcSIP S76S](https://www.acsip.com.tw) | *2.3.0* | |
749749
| :green_heart: | STM32F072C8<br>STM32F072CB | [Elektor LoRa Node](https://github.com/ElektorLabs/180516-Elektor_LoRa_Node) | *1.8.0* | [More info](https://www.elektormagazine.com/labs/lorawan-node-experimental-platform) |
750-
| :green_heart: | STM32L151CB | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | [Wiki](https://github.com/stm32duino/wiki/wiki/Connectivities#lora) |
750+
| :green_heart: | STM32L151CB | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | [Wiki](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Connectivities#lora) |
751751
| :green_heart: | STM32L051C8 | [RHF76-052](https://lora-alliance.org/lora_products/rhf76-052/) | *1.7.0* | Basic support |
752752

753753
### [Midatronics](https://midatronics.com/) boards

README_CMAKE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CMake can now be used to build Arduino sketches with this core.
22
Examples of use can be found on this repo: [stm32duino/CMake_workspace](https://github.com/stm32duino/CMake_workspace).
33

44
This README only provides a quick walk-through.
5-
For all the glorious details, please head over to [the wiki](https://github.com/stm32duino/wiki/wiki/CMake_presentation).
5+
For all the glorious details, please head over to [the wiki](https://github.com/stm32duino/Arduino_Core_STM32/wiki/CMake_presentation).
66

77
# Prerequisites
88

cmake/FindArduinoCtags.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ include(FetchContent)
33
include(FindPackageHandleStandardArgs)
44

55
function(get_ctags)
6+
7+
# Prevent warnings in CMake>=3.24 regarding ExternalProject_Add()
8+
# cf. https://cmake.org/cmake/help/latest/policy/CMP0135.html
9+
cmake_policy(SET CMP0135 OLD)
10+
611
cmake_host_system_information(
712
RESULT HOSTINFO
813
QUERY OS_NAME OS_PLATFORM

cmake/ensure_core_deps.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ function(get_target_url JSONARR OUT_URL OUT_SHA)
5858
endfunction()
5959

6060
function(declare_deps CORE_VERSION)
61+
62+
# Prevent warnings in CMake>=3.24 regarding ExternalProject_Add()
63+
# cf. https://cmake.org/cmake/help/latest/policy/CMP0135.html
64+
cmake_policy(SET CMP0135 OLD)
65+
6166
file(REAL_PATH "${DL_DIR}/package_stmicroelectronics_index.json" JSONFILE)
6267
if (NOT EXISTS ${JSONFILE})
6368
file(DOWNLOAD "${JSONCONFIG_URL}" ${JSONFILE})

cmake/scripts/cmake_easy_setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def get_boards(boardstxt):
206206
Unless you are building a very simple sketch with no library (e.g., Blink),
207207
you are advised to edit this file to fill in any missing dependency relationship.
208208
For details, please refer to
209-
https://github.com/stm32duino/wiki/wiki/Arduino-%28in%29compatibility#library-management
209+
https://github.com/stm32duino/Arduino_Core_STM32/wiki/Arduino-%28in%29compatibility#library-management
210210
"""
211211
)
212212

cmake/toolchain.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ find_program(DOT "dot")
4040
include("${CMAKE_CURRENT_LIST_DIR}/ensure_core_deps.cmake")
4141
ensure_core_deps()
4242

43-
# Setting Linux is forcing th extension to be .o instead of .obj when building on WIndows.
43+
# Setting Linux is forcing the extension to be .o instead of .obj when building on Windows.
4444
# It is important because armlink is failing when files have .obj extensions (error with
4545
# scatter file section not found)
4646
SET(CMAKE_SYSTEM_NAME Linux)
@@ -49,8 +49,8 @@ SET(CMAKE_SYSTEM_PROCESSOR arm)
4949
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) # don't try to link when testing the compiler, it won't work anyway
5050
set(BUILD_SHARED_LIBS false CACHE STRING "")
5151

52-
set(CMAKE_CXX_STANDARD 14)
53-
set(CMAKE_C_STANDARD 11)
52+
set(CMAKE_CXX_STANDARD 17)
53+
set(CMAKE_C_STANDARD 17)
5454

5555
set(CMAKE_EXECUTABLE_SUFFIX .elf)
5656
# These override CMAKE_EXECUTABLE_SUFFIX -- prevent any CMake built-in from overriding the value we want

cores/arduino/HardwareSerial.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,15 @@ HardwareSerial::HardwareSerial(void *peripheral, HalfDuplexMode_t halfDuplex)
132132
// If Serial is defined in variant set
133133
// the Rx/Tx pins for com port if defined
134134
#if defined(Serial) && defined(PIN_SERIAL_TX)
135+
#if !defined(USBCON) || defined(USBD_USE_CDC) && defined(DISABLE_GENERIC_SERIALUSB)
135136
if ((void *)this == (void *)&Serial) {
136137
#if defined(PIN_SERIAL_RX)
137138
setRx(PIN_SERIAL_RX);
138139
#endif
139140
setTx(PIN_SERIAL_TX);
140141
} else
141142
#endif
143+
#endif
142144
#if defined(PIN_SERIAL1_TX) && defined(USART1_BASE)
143145
if (peripheral == USART1) {
144146
#if defined(PIN_SERIAL1_RX)

cores/arduino/stm32/stm32_def.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,15 @@
8686
#endif
8787
#endif
8888

89-
/* STM32G0xx defined USB_DRD_FS */
89+
/* STM32G0xx and some STM32U5xx defined USB_DRD_FS */
9090
#if !defined(USB) && defined(USB_DRD_FS)
9191
#define USB USB_DRD_FS
9292
#define PinMap_USB PinMap_USB_DRD_FS
93+
#if defined(STM32U5xx)
94+
#define USB_BASE USB_DRD_BASE
95+
#define __HAL_RCC_USB_CLK_ENABLE __HAL_RCC_USB_FS_CLK_ENABLE
96+
#define __HAL_RCC_USB_CLK_DISABLE __HAL_RCC_USB_FS_CLK_DISABLE
97+
#endif
9398
#endif
9499

95100
/**

cores/arduino/stm32/stm32_def_build.h

+4
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@
414414
#define CMSIS_STARTUP_FILE "startup_stm32mp157cxx_cm4.s"
415415
#elif defined(STM32MP15xx)
416416
#define CMSIS_STARTUP_FILE "startup_stm32mp15xx.s"
417+
#elif defined(STM32U535xx)
418+
#define CMSIS_STARTUP_FILE "startup_stm32u535xx.s"
419+
#elif defined(STM32U545xx)
420+
#define CMSIS_STARTUP_FILE "startup_stm32u545xx.s"
417421
#elif defined(STM32U575xx)
418422
#define CMSIS_STARTUP_FILE "startup_stm32u575xx.s"
419423
#elif defined(STM32U585xx)

cores/arduino/stm32/usb/usbd_conf.c

+2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
105105
#ifdef __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_EDGE
106106
__HAL_USB_WAKEUP_EXTI_ENABLE_RISING_EDGE();
107107
#endif
108+
#ifdef __HAL_USB_WAKEUP_EXTI_ENABLE_IT
108109
__HAL_USB_WAKEUP_EXTI_ENABLE_IT();
110+
#endif
109111
#if defined(USB_WKUP_IRQn)
110112
/* USB Wakeup Interrupt */
111113
HAL_NVIC_EnableIRQ(USB_WKUP_IRQn);

cores/arduino/stm32/usb/usbd_conf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extern "C" {
7474
#elif defined(STM32G0xx)
7575
#define USB_IRQn USB_UCPD1_2_IRQn
7676
#define USB_IRQHandler USB_UCPD1_2_IRQHandler
77-
#elif defined(STM32U5xx)
77+
#elif defined(STM32U5xx) && !defined(USB_DRD_FS)
7878
#define USB_IRQn OTG_FS_IRQn
7979
#define USB_IRQHandler OTG_FS_IRQHandler
8080
#elif defined(STM32L5xx)

libraries/CMSIS_DSP/examples/arm_sin_cos_example_f32/arm_sin_cos_example_f32.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
4848
\par Description:
4949
\par
50-
Demonstrates the Pythagorean trignometric identity with the use of Cosine, Sine, Vector
50+
Demonstrates the Pythagorean trigonometric identity with the use of Cosine, Sine, Vector
5151
Multiplication, and Vector Addition functions.
5252
5353
\par Algorithm:
5454
\par
55-
Mathematically, the Pythagorean trignometric identity is defined by the following equation:
55+
Mathematically, the Pythagorean trigonometric identity is defined by the following equation:
5656
<pre>sin(x) * sin(x) + cos(x) * cos(x) = 1</pre>
5757
where \c x is the angle in radians.
5858

libraries/SoftwareSerial/src/SoftwareSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ inline void SoftwareSerial::recv()
283283
if (inbit) {
284284
rx_buffer |= 0x80;
285285
}
286-
rx_bit_cnt++; // Preprare for next bit
286+
rx_bit_cnt++; // Prepare for next bit
287287
rx_tick_cnt = OVERSAMPLE; // Wait OVERSAMPLE ticks before sampling next bit
288288
}
289289
}

libraries/SrcWrapper/src/stm32/uart.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern "C" {
3636
#define DEBUG_UART_BAUDRATE 9600
3737
#endif
3838

39-
/* @brief uart caracteristics */
39+
/* @brief uart characteristics */
4040
typedef enum {
4141
#if defined(USART1_BASE)
4242
UART1_INDEX,

libraries/Wire/examples/i2c_scanner/i2c_scanner.ino

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// can be found in many places.
77
// For example on the Arduino.cc forum.
88
// The original author is not know.
9-
// Version 2, Juni 2012, Using Arduino 1.0.1
9+
// Version 2, Jun 2012, Using Arduino 1.0.1
1010
// Adapted to be as simple as possible by Arduino.cc user Krodal
1111
// Version 3, Feb 26 2013
1212
// V3 by louarnold
@@ -47,7 +47,7 @@
4747
If you want to use the two I2Cs simultaneously, create a new instance for the second I2C
4848
TwoWire Wire2(PB11,PB10);
4949
Wire2.begin();
50-
50+
5151
*/
5252

5353

@@ -76,21 +76,21 @@ void loop() {
7676

7777
Wire.beginTransmission(address);
7878
error = Wire.endTransmission();
79-
79+
8080
if (error == 0) {
8181
Serial.print("I2C device found at address 0x");
82-
if (address < 16)
82+
if (address < 16)
8383
Serial.print("0");
8484
Serial.println(address, HEX);
8585

8686
nDevices++;
8787
}
8888
else if (error == 4) {
8989
Serial.print("Unknown error at address 0x");
90-
if (address < 16)
90+
if (address < 16)
9191
Serial.print("0");
9292
Serial.println(address, HEX);
93-
}
93+
}
9494
}
9595
if (nDevices == 0)
9696
Serial.println("No I2C devices found");

0 commit comments

Comments
 (0)