Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/drivers/src/vl53l1x.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
#define VL53L1_get_register_name(a,b)
#endif

// Set the start address 1 step after the VL53L0 dynamic addresses
static int nextI2CAddress = RANGER_DECKS_ADDRESS_START +1;
static int nextI2CAddress = RANGER_DECKS_ADDRESS_START;
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VL53L0 and VL53L1 drivers share the same address space but have separate static nextI2CAddress variables. This creates a potential conflict if both sensor types are initialized simultaneously (e.g., Flow Deck v1 with VL53L0 and Multi-ranger with VL53L1). Consider using a shared address counter or documenting that these drivers cannot be mixed.

Suggested change
static int nextI2CAddress = RANGER_DECKS_ADDRESS_START;
// Shared I2C address counter for VL53L0 and VL53L1 drivers.
// Must be defined in a single source file (e.g., vl53l0x.c or a new shared file):
// int nextI2CAddress = RANGER_DECKS_ADDRESS_START;
extern int nextI2CAddress;

Copilot uses AI. Check for mistakes.


bool vl53l1xInit(VL53L1_Dev_t *pdev, I2C_Dev *I2Cx)
Expand Down