We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 50c504d + bed6483 commit e3d1302Copy full SHA for e3d1302
shared-module/bitbangio/SPI.c
@@ -96,7 +96,12 @@ void shared_module_bitbangio_spi_configure(bitbangio_spi_obj_t *self,
96
self->delay_half += 1;
97
}
98
99
- self->polarity = polarity;
+ if (polarity != self->polarity) {
100
+ // If the polarity has changed, make sure we re-initialize the idle state
101
+ // of the clock as well.
102
+ self->polarity = polarity;
103
+ common_hal_digitalio_digitalinout_switch_to_output(&self->clock, polarity == 1, DRIVE_MODE_PUSH_PULL);
104
+ }
105
self->phase = phase;
106
107
0 commit comments