Skip to content

Commit

Permalink
modified MCU_SPI
Browse files Browse the repository at this point in the history
- modified MCU_SPI macro do be usable with or without available HW SPI
  • Loading branch information
Paciente8159 committed Jul 3, 2024
1 parent 96c04c5 commit ac1657b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uCNC/src/modules/softspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "softspi.h"

#ifdef MCU_HAS_SPI
softspi_port_t __attribute__((used)) MCU_SPI = {.spimode = 0, .spifreq = SPI_FREQ, .clk = NULL, .mosi = NULL, .miso = NULL, .config = mcu_spi_config, .start = mcu_spi_start, .xmit = mcu_spi_xmit, .stop = mcu_spi_stop};
softspi_port_t __attribute__((used)) MCU_SPI_PORT = {.spimode = 0, .spifreq = SPI_FREQ, .clk = NULL, .mosi = NULL, .miso = NULL, .config = mcu_spi_config, .start = mcu_spi_start, .xmit = mcu_spi_xmit, .stop = mcu_spi_stop};
#endif

void softspi_config(softspi_port_t *port, uint8_t mode, uint32_t frequency)
Expand Down
5 changes: 4 additions & 1 deletion uCNC/src/modules/softspi.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ extern "C"
void softspi_stop(softspi_port_t *port);

#ifdef MCU_HAS_SPI
extern softspi_port_t MCU_SPI;
extern softspi_port_t MCU_SPI_PORT;
#define MCU_SPI (&MCU_SPI_PORT)
#else
#define MCU_SPI NULL
#endif

#ifdef __cplusplus
Expand Down

0 comments on commit ac1657b

Please sign in to comment.