Skip to content

Commit

Permalink
Relax extern "C" requirement on handler function signature.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyma98 committed Sep 3, 2024
1 parent 36a3b68 commit 2b59574
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ paste = "1.0"

[dependencies.hopter_proc_macro]
git = "https://github.com/ZhiyaoMa98/hopter-procedural-macro.git"
tag = "v0.1.4"
tag = "v0.1.5"

[dependencies.hopter_conf_params]
git = "https://github.com/ZhiyaoMa98/hopter-conf-params.git"
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/interrupt/unwind/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn main(_cp: cortex_m::Peripherals) {

/// Get invoked approximately every 1 second.
#[handler(TIM2)]
extern "C" fn tim2_handler() {
fn tim2_handler() {
static IRQ_CNT: AtomicUsize = AtomicUsize::new(0);
let prev_cnt = IRQ_CNT.fetch_add(1, Ordering::SeqCst);

Expand Down
2 changes: 1 addition & 1 deletion examples/tests/sync/channel/try_consume_from_isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn produce_function(producer: Producer<usize, 2>) {

/// Get invoked approximately every 1 second.
#[handler(TIM2)]
extern "C" fn tim2_handler() {
fn tim2_handler() {
static COUNT: AtomicUsize = AtomicUsize::new(0);
COUNT.fetch_add(1, Ordering::SeqCst);

Expand Down
2 changes: 1 addition & 1 deletion examples/tests/sync/channel/try_produce_from_isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn consume_function(consumer: Consumer<usize, 2>) {

/// Get invoked approximately every 1 second.
#[handler(TIM2)]
extern "C" fn tim2_handler() {
fn tim2_handler() {
static COUNT: AtomicUsize = AtomicUsize::new(0);
let prev_cnt = COUNT.fetch_add(1, Ordering::SeqCst);

Expand Down
2 changes: 1 addition & 1 deletion examples/tests/sync/mailbox/notify_from_isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn listener_function() {

/// Get invoked approximately every 1 second.
#[handler(TIM2)]
extern "C" fn tim2_handler() {
fn tim2_handler() {
static IRQ_CNT: AtomicUsize = AtomicUsize::new(0);

MAILBOX.notify_allow_isr();
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/sync/semaphore/try_down_from_isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn up_function() {

/// Get invoked approximately every 1 second.
#[handler(TIM2)]
extern "C" fn tim2_handler() {
fn tim2_handler() {
// Only run this handler for three times. If running more than three times,
// the test task must have been stuck.
static COUNT: AtomicUsize = AtomicUsize::new(0);
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/sync/semaphore/try_up_from_isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn down_function() {

/// Get invoked approximately every 1 second.
#[handler(TIM2)]
extern "C" fn tim2_handler() {
fn tim2_handler() {
// Only run this handler for three times. If running more than three times,
// the test task must have been stuck.
static COUNT: AtomicUsize = AtomicUsize::new(0);
Expand Down

0 comments on commit 2b59574

Please sign in to comment.