boards: Seeeduino XIAO BLE charge current select.#10
Open
petejohanson wants to merge 1 commit intozmkfirmware:v3.0.0+zmk-fixesfrom
Open
boards: Seeeduino XIAO BLE charge current select.#10petejohanson wants to merge 1 commit intozmkfirmware:v3.0.0+zmk-fixesfrom
petejohanson wants to merge 1 commit intozmkfirmware:v3.0.0+zmk-fixesfrom
Conversation
Add board Kconfig option to allow selecting a fixed charge current, either 50mA or 100mA, at startup. Signed-off-by: Peter Johanson <peter@peterjohanson.com>
|
After a haphazard attempt to update this for Zephyr 3.2 (see below), the config seems to be working well. I missed when the charging light turned off so I couldn't calculate for sure, but I definitely got >65 mAh whereas I used to get <50 mAh without this patch. diff --git a/boards/arm/seeeduino_xiao_ble/board.c b/boards/arm/seeeduino_xiao_ble/board.c
index 79143a9c5f..f4312df2a8 100644
--- a/boards/arm/seeeduino_xiao_ble/board.c
+++ b/boards/arm/seeeduino_xiao_ble/board.c
@@ -4,16 +4,15 @@
* SPDX-License-Identifier: Apache-2.0
*/
-#include <init.h>
+#include <zephyr/init.h>
#include <hal/nrf_gpio.h>
#include <nrfx.h>
-#include <device.h>
-#include <drivers/gpio.h>
+#include <zephyr/device.h>
+#include <zephyr/drivers/gpio.h>
-#include <logging/log.h>
+#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(seeeduino_xiao_ble_board_init);
-#define XIAO_BLE_CHARGE_CTRL_PORT DT_LABEL(DT_NODELABEL(gpio0))
#define XIAO_BLE_CHARGE_CTRL_PIN 13
static int setup(const struct device *dev)
@@ -23,9 +22,9 @@ static int setup(const struct device *dev)
const struct device *gpio;
int err;
- gpio = device_get_binding(XIAO_BLE_CHARGE_CTRL_PORT);
+ gpio = DEVICE_DT_GET(DT_NODELABEL(gpio0));
if (!gpio) {
- LOG_ERR("Could not bind device \"%s\"", XIAO_BLE_CHARGE_CTRL_PORT);
+ LOG_ERR("Could not bind gpio0 device");
return -ENODEV;
}
|
|
I suppose this could be implemented with GPIO hogging in Zephyr 3.5. I'll drop a note here if I figure it out! |
HOG is introduced in 3.3 btw |
|
I found a way to make it work with GPIO hogging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add board Kconfig option to allow selecting a fixed charge current, either 50mA or 100mA, at startup.
Signed-off-by: Peter Johanson peter@peterjohanson.com