Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed I2C deprecated definitions #817

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions uCNC/src/hal/boards/pin_mapping_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -1404,13 +1404,13 @@ extern "C"
#define SPI_CS_BIT MCU_PIN(SPI_CS_PIN,BIT)
#define SPI_CS_PORT MCU_PIN(SPI_CS_PIN,PORT)
#endif
#if (defined(I2C_SCL_PIN) && !(defined(I2C_SCL_BIT) || defined(I2C_SCL_PORT)))
#define I2C_SCL_BIT MCU_PIN(I2C_SCL_PIN,BIT)
#define I2C_SCL_PORT MCU_PIN(I2C_SCL_PIN,PORT)
#if (defined(I2C_CLK_PIN) && !(defined(I2C_CLK_BIT) || defined(I2C_CLK_PORT)))
#define I2C_CLK_BIT MCU_PIN(I2C_CLK_PIN,BIT)
#define I2C_CLK_PORT MCU_PIN(I2C_CLK_PIN,PORT)
#endif
#if (defined(I2C_SDA_PIN) && !(defined(I2C_SDA_BIT) || defined(I2C_SDA_PORT)))
#define I2C_SDA_BIT MCU_PIN(I2C_SDA_PIN,BIT)
#define I2C_SDA_PORT MCU_PIN(I2C_SDA_PIN,PORT)
#if (defined(I2C_DATA_PIN) && !(defined(I2C_DATA_BIT) || defined(I2C_DATA_PORT)))
#define I2C_DATA_BIT MCU_PIN(I2C_DATA_PIN,BIT)
#define I2C_DATA_PORT MCU_PIN(I2C_DATA_PIN,PORT)
#endif
#if (defined(TX2_PIN) && !(defined(TX2_BIT) || defined(TX2_PORT)))
#define TX2_BIT MCU_PIN(TX2_PIN,BIT)
Expand Down
4 changes: 2 additions & 2 deletions uCNC/src/hal/mcus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ These pins also obey a numbering system to make them transversal between boards
| 205 | DIO205 | SPI_SDI |
| 206 | DIO206 | SPI_SDO |
| 207 | DIO207 | SPI_CS |
| 208 | DIO208 | I2C_SCL |
| 209 | DIO209 | I2C_SDA |
| 208 | DIO208 | I2C_CLK |
| 209 | DIO209 | I2C_DATA |
| 210 | DIO210 | TX2 |
| 211 | DIO211 | RX2 |
| 212 | DIO212 | SPI2_CLK |
Expand Down
42 changes: 23 additions & 19 deletions uCNC/src/hal/mcus/stm32f0x/mcumap_stm32f0x.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ extern "C"
#define F_CPU SystemCoreClock
#endif

#ifndef HSI_VALUE
#define HSI_VALUE 8000000UL
#endif

// defines the maximum and minimum step rates
#ifndef F_STEP_MAX
#define F_STEP_MAX 100000
Expand Down Expand Up @@ -2058,25 +2062,25 @@ extern "C"
#define DIO207_AHBEN SPI_CS_AHBEN
#define DIO207_GPIO SPI_CS_GPIO
#endif
#if (defined(I2C_SCL_PORT) && defined(I2C_SCL_BIT))
#define I2C_SCL 208
#define I2C_SCL_AHBEN (__rccgpioen__(I2C_SCL_PORT))
#define I2C_SCL_GPIO (__gpio__(I2C_SCL_PORT))
#if (defined(I2C_CLK_PORT) && defined(I2C_CLK_BIT))
#define I2C_CLK 208
#define I2C_CLK_AHBEN (__rccgpioen__(I2C_CLK_PORT))
#define I2C_CLK_GPIO (__gpio__(I2C_CLK_PORT))
#define DIO208 208
#define DIO208_PORT I2C_SCL_PORT
#define DIO208_BIT I2C_SCL_BIT
#define DIO208_AHBEN I2C_SCL_AHBEN
#define DIO208_GPIO I2C_SCL_GPIO
#endif
#if (defined(I2C_SDA_PORT) && defined(I2C_SDA_BIT))
#define I2C_SDA 209
#define I2C_SDA_AHBEN (__rccgpioen__(I2C_SDA_PORT))
#define I2C_SDA_GPIO (__gpio__(I2C_SDA_PORT))
#define DIO208_PORT I2C_CLK_PORT
#define DIO208_BIT I2C_CLK_BIT
#define DIO208_AHBEN I2C_CLK_AHBEN
#define DIO208_GPIO I2C_CLK_GPIO
#endif
#if (defined(I2C_DATA_PORT) && defined(I2C_DATA_BIT))
#define I2C_DATA 209
#define I2C_DATA_AHBEN (__rccgpioen__(I2C_DATA_PORT))
#define I2C_DATA_GPIO (__gpio__(I2C_DATA_PORT))
#define DIO209 209
#define DIO209_PORT I2C_SDA_PORT
#define DIO209_BIT I2C_SDA_BIT
#define DIO209_AHBEN I2C_SDA_AHBEN
#define DIO209_GPIO I2C_SDA_GPIO
#define DIO209_PORT I2C_DATA_PORT
#define DIO209_BIT I2C_DATA_BIT
#define DIO209_AHBEN I2C_DATA_AHBEN
#define DIO209_GPIO I2C_DATA_GPIO
#endif
#if (defined(TX2_PORT) && defined(TX2_BIT))
#define TX2 210
Expand Down Expand Up @@ -4607,8 +4611,8 @@ extern "C"
#define I2C_DATA_AFIO 5
#endif

#define I2C_IRQ __helper__(I2C, I2C_PORT, _EV_IRQn)
#define I2C_ISR __helper__(I2C, I2C_PORT, _EV_IRQHandler)
#define I2C_IRQ __helper__(I2C, I2C_PORT, _IRQn)
#define I2C_ISR __helper__(I2C, I2C_PORT, _IRQHandler)

#ifndef I2C_FREQ
#define I2C_FREQ 400000UL
Expand Down
4 changes: 2 additions & 2 deletions uCNC/src/hal/mcus/virtual/mcumap_virtual.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@
#define DIO206 206
#define SPI_CS 207
#define DIO207 207
#define I2C_SCL 208
#define I2C_CLK 208
#define DIO208 208
#define I2C_SDA 209
#define I2C_DATA 209
#define DIO209 209
#define TX2 210
#define DIO210 210
Expand Down
4 changes: 2 additions & 2 deletions uCNC/src/interface/grbl_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ const char pin_name_204[] __rom__ = "SPI_CLK";
const char pin_name_205[] __rom__ = "SPI_SDI";
const char pin_name_206[] __rom__ = "SPI_SDO";
const char pin_name_207[] __rom__ = "SPI_CS";
const char pin_name_208[] __rom__ = "I2C_SCL";
const char pin_name_209[] __rom__ = "I2C_SDA";
const char pin_name_208[] __rom__ = "I2C_CLK";
const char pin_name_209[] __rom__ = "I2C_DATA";
const char pin_name_210[] __rom__ = "TX2";
const char pin_name_211[] __rom__ = "RX2";
const char pin_name_212[] __rom__ = "SPI2_CLK";
Expand Down
Loading