From 6f5ffd80e1346b71dd92eab2aa4b3489a492703a Mon Sep 17 00:00:00 2001 From: "Paulus H.J. Schulinck" Date: Sat, 1 Oct 2022 21:34:12 +0100 Subject: [PATCH 1/8] I did not make changes in ports-broadcom-firmware I made a fresh fork of circuitpython. Using Github Desktop app, created a local clone of this fork. Then Desktop app confronted me we a change in ports\broadcom\firmware -Subproject commit .nr.... and +Subproject commit same nr-dirty. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2fdfe207a2..8f5238ec53 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ TAGS # Uncrustify formatting *.uncrustify +ports/broadcom/firmware From d66eeaab26ca3cf1e86d5317a277e23a8b78741d Mon Sep 17 00:00:00 2001 From: "Paulus H.J. Schulinck" Date: Sat, 1 Oct 2022 21:56:07 +0100 Subject: [PATCH 2/8] Update I2CTarget.c Modification of the doc text of function request(). 1) The timout parameter is a keyword-only argument; so Added '*,' in the function signature; 2) for parameter timeout an integer is expected, not a float. --- shared-bindings/i2ctarget/I2CTarget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/i2ctarget/I2CTarget.c b/shared-bindings/i2ctarget/I2CTarget.c index 3513dee29b..3e0c123738 100644 --- a/shared-bindings/i2ctarget/I2CTarget.c +++ b/shared-bindings/i2ctarget/I2CTarget.c @@ -130,7 +130,7 @@ STATIC mp_obj_t i2ctarget_i2c_target_obj___exit__(size_t n_args, const mp_obj_t } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2ctarget_i2c_target___exit___obj, 4, 4, i2ctarget_i2c_target_obj___exit__); -//| def request(self, timeout: float = -1) -> I2CTargetRequest: +//| def request(self, *, timeout: int = -1) -> I2CTargetRequest: //| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once From 041766351c1bc650a57edf4d0d17a388b77e179c Mon Sep 17 00:00:00 2001 From: "Paulus H.J. Schulinck" Date: Sat, 1 Oct 2022 22:23:17 +0100 Subject: [PATCH 3/8] Update I2CTarget.c Correction in function request() doc function signature. (after speaking with @jepler on Discord). (@jepler: 'Circuitpython always has floats enabled') --- shared-bindings/i2ctarget/I2CTarget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/i2ctarget/I2CTarget.c b/shared-bindings/i2ctarget/I2CTarget.c index 3e0c123738..17da952118 100644 --- a/shared-bindings/i2ctarget/I2CTarget.c +++ b/shared-bindings/i2ctarget/I2CTarget.c @@ -130,7 +130,7 @@ STATIC mp_obj_t i2ctarget_i2c_target_obj___exit__(size_t n_args, const mp_obj_t } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2ctarget_i2c_target___exit___obj, 4, 4, i2ctarget_i2c_target_obj___exit__); -//| def request(self, *, timeout: int = -1) -> I2CTargetRequest: +//| def request(self, *, timeout: float = -1) -> I2CTargetRequest: //| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once From 89e0601a3987dcd26b655e3dad4b378cac828a2f Mon Sep 17 00:00:00 2001 From: "Paulus H.J. Schulinck" Date: Mon, 3 Oct 2022 13:09:40 +0100 Subject: [PATCH 4/8] Update I2CTarget.c Correction of the timeout value range needed to set the timeout to 'forever'. The line 162 checks timeout for a value of 0 while the function definition defaults timeout to -1. In the current version of the code timeout is only checked for a value of 0 or in the 'else if' part for a value of > 0. So, values of <0 will not be taken in to account. That is the reason of my modification. --- shared-bindings/i2ctarget/I2CTarget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/i2ctarget/I2CTarget.c b/shared-bindings/i2ctarget/I2CTarget.c index 17da952118..4dc5b775f4 100644 --- a/shared-bindings/i2ctarget/I2CTarget.c +++ b/shared-bindings/i2ctarget/I2CTarget.c @@ -159,7 +159,7 @@ STATIC mp_obj_t i2ctarget_i2c_target_request(size_t n_args, const mp_obj_t *pos_ bool forever = false; uint64_t timeout_end = 0; - if (timeout_ms == 0) { + if (timeout_ms <= 0) { forever = true; } else if (timeout_ms > 0) { timeout_end = common_hal_time_monotonic_ms() + timeout_ms; From 1e98f9125f033e5b7734814874471f576ef5f5ad Mon Sep 17 00:00:00 2001 From: "Paulus H.J. Schulinck" Date: Mon, 3 Oct 2022 13:25:12 +0100 Subject: [PATCH 5/8] Update .gitisnore Removed the -# Uncrustify formatting for file ports/broadcom/firmware I don't know how it came into there. I didn't put it. It is not my intention to change anything else than this branch to make 2 changes in shared_bindings/I2CTarget module --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8f5238ec53..5cf0886570 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,4 @@ TAGS .venv .env -# Uncrustify formatting -*.uncrustify -ports/broadcom/firmware + From a5d7dbd1163f5b5b68049e622dbfd155e3549498 Mon Sep 17 00:00:00 2001 From: "Paulus H.J. Schulinck" Date: Mon, 3 Oct 2022 13:29:29 +0100 Subject: [PATCH 6/8] Update .gitignore I made an error. I deleted too much at the end of this file. Correction made. It is now (the Uncrustify formatting) as in branch 'main' --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5cf0886570..6e4a3faffd 100644 --- a/.gitignore +++ b/.gitignore @@ -88,4 +88,6 @@ TAGS .venv .env +# Uncrustify formatting +*.uncrustify From 0f86f01515ed56b32167db117f3280524c6ed5af Mon Sep 17 00:00:00 2001 From: "Paulus H.J. Schulinck" Date: Mon, 3 Oct 2022 19:28:43 +0100 Subject: [PATCH 7/8] Updates by local pre-commit Pre-commit adjusted some line/file endings --- .gitignore | 1 - tests/pyboard.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6e4a3faffd..2fdfe207a2 100644 --- a/.gitignore +++ b/.gitignore @@ -90,4 +90,3 @@ TAGS # Uncrustify formatting *.uncrustify - diff --git a/tests/pyboard.py b/tests/pyboard.py index 616773a313..582a1f894f 120000 --- a/tests/pyboard.py +++ b/tests/pyboard.py @@ -1 +1 @@ -../tools/cpboard.py \ No newline at end of file +../tools/cpboard.py From b1106b8f2f44192191c24ab3fad31afa49e80684 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 3 Oct 2022 15:05:30 -0500 Subject: [PATCH 8/8] restore pyboard symlink This item is a UNIX symbolic link, and (except in the unlikely case where the symlink is to a pathname that ends with a newline character!) doesn't contain a newline. It appears some well-intentioned tool failed to correctly handle this file, and added a trailing newline as though it was a text file. --- tests/pyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pyboard.py b/tests/pyboard.py index 582a1f894f..616773a313 120000 --- a/tests/pyboard.py +++ b/tests/pyboard.py @@ -1 +1 @@ -../tools/cpboard.py +../tools/cpboard.py \ No newline at end of file