From 702e96c7e410a918ad1df1246f8e5039942880a7 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 16 Nov 2024 11:26:39 -0600 Subject: [PATCH] pbdrv/usb: freeze pbdrv_usb_bcd_t values Since these are part of the API now, we don't want the values to change. --- lib/pbio/include/pbdrv/usb.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/pbio/include/pbdrv/usb.h b/lib/pbio/include/pbdrv/usb.h index 1a4a40515..08c8a4f4e 100644 --- a/lib/pbio/include/pbdrv/usb.h +++ b/lib/pbio/include/pbdrv/usb.h @@ -15,16 +15,18 @@ * Indicates battery charging capabilites that were detected on a USB port. */ typedef enum { + // NOTE: These values are part of the MicroPython API, don't change the numbers. + /** The USB cable is not connected (no VBUS). */ - PBDRV_USB_BCD_NONE, + PBDRV_USB_BCD_NONE = 0, /** The USB cable is connected to a non-standard charger or PS/2 port. */ - PBDRV_USB_BCD_NONSTANDARD, + PBDRV_USB_BCD_NONSTANDARD = 1, /** The USB cable is connected to standard downstream port. */ - PBDRV_USB_BCD_STANDARD_DOWNSTREAM, + PBDRV_USB_BCD_STANDARD_DOWNSTREAM = 2, /** The USB cable is connected to charging downstream port. */ - PBDRV_USB_BCD_CHARGING_DOWNSTREAM, + PBDRV_USB_BCD_CHARGING_DOWNSTREAM = 3, /** The USB cable is connected to dedicated charging port. */ - PBDRV_USB_BCD_DEDICATED_CHARGING, + PBDRV_USB_BCD_DEDICATED_CHARGING = 4, } pbdrv_usb_bcd_t; #if PBDRV_CONFIG_USB