Skip to content

Commit 8309a23

Browse files
committed
mcp4822 CS/MOSI argument fix, as per requested
1 parent 072c277 commit 8309a23

File tree

1 file changed

+1
-2
lines changed
  • ports/raspberrypi/common-hal/mcp4822

1 file changed

+1
-2
lines changed

ports/raspberrypi/common-hal/mcp4822/MCP4822.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ void common_hal_mcp4822_mcp4822_construct(mcp4822_mcp4822_obj_t *self,
143143
// The SET pin group spans from MOSI to CS.
144144
// MOSI must have a lower GPIO number than CS, gap at most 4.
145145
if (cs->number <= mosi->number || (cs->number - mosi->number) > 4) {
146-
mp_raise_ValueError(
147-
MP_ERROR_TEXT("cs pin must be 1-4 positions above mosi pin"));
146+
mp_raise_ValueError_varg(MP_ERROR_TEXT("Invalid %q and %q"), MP_QSTR_CS, MP_QSTR_MOSI);
148147
}
149148

150149
uint8_t set_count = cs->number - mosi->number + 1;

0 commit comments

Comments
 (0)