Skip to content

Commit 444952f

Browse files
mcbridejcsalkinium
authored andcommitted
Bug fixes for SAMG family
- Adds missing isSet method, and fixes an error in read() for GPIO driver - Disables mode fault detection in spi driver The driver does not use the hardware controlled chip select, so mode fault doesn't make sense, and leads to failures depending on the state of the CS pin.
1 parent 0d6a937 commit 444952f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/modm/platform/gpio/sam/pin.hpp.in

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,19 @@ public:
412412
read()
413413
{
414414
%% if target["family"] in ["g", "v"]
415-
return Base::readPortReg<PinConfig::port>(PIO_PDSR_OFFSET);
415+
return Base::template readPortReg<PinConfig::port>(PIO_PDSR_OFFSET);
416416
%% else
417-
return Base::readPortReg<PinConfig::port>(PORT_IN_OFFSET);
417+
return Base::template readPortReg<PinConfig::port>(PORT_IN_OFFSET);
418+
%% endif
419+
}
420+
421+
inline static bool
422+
isSet()
423+
{
424+
%% if target["family"] in ["g", "v"]
425+
return Base::template readPortReg<PinConfig::port>(PIO_ODSR_OFFSET);
426+
%% else
427+
return Base::template readPortReg<PinConfig::port>(PORT_OUT_OFFSET);
418428
%% endif
419429
}
420430

src/modm/platform/spi/sam/spi_master.hpp.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public:
9696
assertBaudrateInTolerance< result.frequency, baudrate, tolerance >();
9797

9898
Regs()->SPI_CSR[0] = SPI_CSR_SCBR(result.prescaler);
99-
Regs()->SPI_MR = SPI_MR_MSTR;
99+
Regs()->SPI_MR = SPI_MR_MSTR | SPI_MR_MODFDIS;
100100
Regs()->SPI_CR |= SPI_CR_SPIEN;
101101
}
102102

0 commit comments

Comments
 (0)