[fix][lpc21] workaround for init of spi_slave_hs

This commit is contained in:
Felix Ruess
2013-07-31 00:35:01 +02:00
parent f5c391f414
commit 93372df379
4 changed files with 10 additions and 3 deletions
@@ -1,7 +1,7 @@
# Hey Emacs, this is a -*- makefile -*-
#generic spi driver
$(TARGET).CFLAGS += -DUSE_SPI
$(TARGET).CFLAGS += -DUSE_SPI -DSPI_SLAVE_HS
ifeq ($(TARGET), sim)
else
@@ -47,7 +47,6 @@ uint8_t spi_slave_hs_tx_insert_idx, spi_slave_hs_tx_extract_idx;
uint8_t spi_slave_hs_tx_buffer[SPI_SLAVE_HS_TX_BUFFER_SIZE];
/* Prototypes */
// void spi_init( void ); // -> declared in spi.h
static void SSP_ISR(void) __attribute__((naked));
/* SSPCR0 settings */
@@ -105,7 +104,7 @@ static void SSP_ISR(void) __attribute__((naked));
#endif
void spi_init(void) {
void spi_slave_hs_init(void) {
/* setup pins for SSP (SCK, MISO, MOSI) */
PINSEL1 |= SSP_PINSEL1_SCK | SSP_PINSEL1_MISO | SSP_PINSEL1_MOSI | SSP_PINSEL1_SSEL;
+4
View File
@@ -143,6 +143,10 @@ void mcu_init(void) {
spi3_slave_init();
#endif
#endif // SPI_SLAVE
#if SPI_SLAVE_HS
spi_slave_hs_init();
#endif
#endif // USE_SPI
#ifdef USE_DAC
+4
View File
@@ -359,4 +359,8 @@ extern bool_t spi_slave_wait(struct spi_periph* p);
/** @}*/
/** @}*/
#if SPI_SLAVE_HS
extern void spi_slave_hs_init(void);
#endif
#endif /* SPI_H */