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

boards/ek-lm4f120x: Change internal LED macro for C2Rust compatibility #20831

Merged
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
24 changes: 14 additions & 10 deletions boards/ek-lm4f120xl/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,26 @@ extern "C" {
#define LED1_PIN GPIO_PIN(5, 2)
#define LED2_PIN GPIO_PIN(5, 3)

#define LED_PORT (GPIO_PORTF_DATA_R)
/**
* @brief Port used for `LED0_ON` and similar implementations
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is LED0_ON and not @ref LED0_ON because Doxygen could not resolve that.

* @internal
* */
#define LED_PORT() (GPIO_PORTF_DATA_R)
#define LED0_MASK (1 << 7)
#define LED1_MASK (1 << 2)
#define LED2_MASK (1 << 1)

#define LED0_ON (LED_PORT |= LED0_MASK)
#define LED0_OFF (LED_PORT &= ~LED0_MASK)
#define LED0_TOGGLE (LED_PORT ^= LED0_MASK)
#define LED0_ON (LED_PORT() |= LED0_MASK)
#define LED0_OFF (LED_PORT() &= ~LED0_MASK)
#define LED0_TOGGLE (LED_PORT() ^= LED0_MASK)

#define LED1_ON (LED_PORT |= LED1_MASK)
#define LED1_OFF (LED_PORT &= ~LED1_MASK)
#define LED1_TOGGLE (LED_PORT ^= LED1_MASK)
#define LED1_ON (LED_PORT() |= LED1_MASK)
#define LED1_OFF (LED_PORT() &= ~LED1_MASK)
#define LED1_TOGGLE (LED_PORT() ^= LED1_MASK)

#define LED2_ON (LED_PORT |= LED2_MASK)
#define LED2_OFF (LED_PORT &= ~LED2_MASK)
#define LED2_TOGGLE (LED_PORT ^= LED2_MASK)
#define LED2_ON (LED_PORT() |= LED2_MASK)
#define LED2_OFF (LED_PORT() &= ~LED2_MASK)
#define LED2_TOGGLE (LED_PORT() ^= LED2_MASK)
/** @} */

/**
Expand Down
4 changes: 0 additions & 4 deletions examples/rust-gcoap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ BASELIBS += $(APPLICATION_RUST_MODULE).module

FEATURES_REQUIRED += rust_target

# Currently unknown, something related to the LED_PORT definition that doesn't
# pass C2Rust's transpilation
BOARD_BLACKLIST := ek-lm4f120xl

include $(RIOTBASE)/Makefile.include
4 changes: 0 additions & 4 deletions examples/rust-hello-world/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ BASELIBS += $(APPLICATION_RUST_MODULE).module

FEATURES_REQUIRED += rust_target

# Currently unknown, something related to the LED_PORT definition that doesn't
# pass C2Rust's transpilation
BOARD_BLACKLIST := ek-lm4f120xl

include $(RIOTBASE)/Makefile.include
4 changes: 0 additions & 4 deletions tests/rust_libs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ USEMODULE += ztimer_msec

FEATURES_REQUIRED += rust_target

# Currently unknown, something related to the LED_PORT definition that doesn't
# pass C2Rust's transpilation
BOARD_BLACKLIST := ek-lm4f120xl

include $(RIOTBASE)/Makefile.include
4 changes: 0 additions & 4 deletions tests/rust_minimal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ BASELIBS += $(APPLICATION_RUST_MODULE).module

FEATURES_REQUIRED += rust_target

# Currently unknown, something related to the LED_PORT definition that doesn't
# pass C2Rust's transpilation
BOARD_BLACKLIST := ek-lm4f120xl

include $(RIOTBASE)/Makefile.include
Loading