Skip to content

Commit

Permalink
Merge pull request #17234 from fjmolinas/pr_cocci_ztimer_fixes
Browse files Browse the repository at this point in the history
sys/ztimer/xtimer2ztimer.cocci: extend and fix api replacements
  • Loading branch information
kaspar030 authored Nov 19, 2021
2 parents 2226dc6 + e6a79c8 commit 4c03d10
Showing 1 changed file with 59 additions and 3 deletions.
62 changes: 59 additions & 3 deletions sys/ztimer/xtimer2ztimer.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ expression e;
expression e;
@@

- xtimer_msleep(e)
+ ztimer_sleep(ZTIMER_MSEC, e)

@@
expression e;
@@

- xtimer_sleep(e)
+ ztimer_sleep(ZTIMER_MSEC, e * 1000)

@@
expression e;
@@

- xtimer_set(e)
+ ztimer_set(ZTIMER_USEC, e)

Expand All @@ -29,6 +43,20 @@ expression e;
- xtimer_remove(e)
+ ztimer_remove(ZTIMER_USEC, e)

@@
expression e;
@@

- xtimer_now_usec(e)
+ ztimer_now(ZTIMER_USEC, e)

@@
expression e;
@@

- xtimer_now_msec(e)
+ ztimer_now(ZTIMER_MSEC, e)

@@
expression e, e2;
@@
Expand All @@ -55,13 +83,13 @@ identifier i;
@@

- xtimer_now_usec()
+ ztimer_get(ZTIMER_USEC)
+ ztimer_now(ZTIMER_USEC)

@@
@@

- _xtimer_now()
+ ztimer_get(ZTIMER_USEC)
+ ztimer_now(ZTIMER_USEC)

@@
@@
Expand Down Expand Up @@ -166,11 +194,39 @@ expression e;
@@

- xtimer_now()
+ ztimer_get(ZTIMER_USEC)
+ ztimer_now(ZTIMER_USEC)

@@
@@

- MODULE_XTIMER
+ MODULE_ZTIMER

@@
expression e, e2;
@@

- xtimer_periodic_wakeup(e, e2)
+ ztimer_periodic_wakeup(ZTIMER_USEC, e, e2)

@@
expression e, e2;
@@

- xtimer_set_timeout_flag(e, e2)
+ ztimer_set_timeout_flag(ZTIMER_USEC, e, e2)


@@
expression e, e2;
@@

- xtimer_mutex_lock_timeout(e, e2)
+ ztimer_mutex_lock_timeout(ZTIMER_USEC, e, e2)

@@
expression e, e2;
@@

- xtimer_msg_receive_timeout(e, e2)
+ ztimer_msg_receive_timeout(ZTIMER_USEC, e, e2)

0 comments on commit 4c03d10

Please sign in to comment.