Skip to content

Commit

Permalink
[avr] Fix swapped Mode 1 and 2 in AVR SPI driver
Browse files Browse the repository at this point in the history
The SPI modes 1 and 2 were swapped in the AT90, ATTINY and ATMEGA SPI
driver. The SPI UART driver is not affected and has always been using
the correct modes.
  • Loading branch information
chris-durand committed Sep 3, 2021
1 parent e8eb662 commit 462a29c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modm/platform/spi/at90_tiny_mega/spi_master.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public:
DataMode : uint8_t
{
Mode0 = 0, ///< clock normal, sample on rising edge
Mode1 = (1 << CPOL{{ id }}), ///< clock normal, sample on falling edge
Mode2 = (1 << CPHA{{ id }}), ///< clock inverted, sample on rising edge
Mode3 = (1 << CPOL{{ id }}) | (1 << CPHA{{ id }}), ///< clock inverted, sample on falling edge
Mode1 = (1 << CPHA{{ id }}), ///< clock normal, sample on falling edge
Mode2 = (1 << CPOL{{ id }}), ///< clock inverted, sample on falling edge
Mode3 = (1 << CPOL{{ id }}) | (1 << CPHA{{ id }}), ///< clock inverted, sample on rising edge
};

public:
Expand Down

0 comments on commit 462a29c

Please sign in to comment.