-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drv/clock: move clock driver out of contiki
This refactors the code base to use pbdrv_clock_* instead of clock_* from contiki. This is a step towards eliminating contiki from the public API, which will be nice if we ever have PBIO as a stand-alone C library. It also simplifies the code a bit since it gets rid of clock_from_msec() and clock_to_msec() which were NOPs in the PBIO library anyway. clock_delay_usec() is moved into the MicroPython code (as mp_hal_delay_us()) since we want to avoid any blocking functions in PBIO.
- Loading branch information
Showing
67 changed files
with
309 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2020 The Pybricks Authors | ||
// Copyright (c) 2018-2021 The Pybricks Authors | ||
|
||
#include <contiki.h> | ||
#include <pbdrv/clock.h> | ||
|
||
void mp_hal_set_interrupt_char(int c); | ||
#define mp_hal_ticks_ms clock_time | ||
#define mp_hal_ticks_us clock_usecs | ||
#define mp_hal_delay_us clock_delay_usec | ||
#define mp_hal_ticks_ms pbdrv_clock_get_ms | ||
#define mp_hal_ticks_us pbdrv_clock_get_us | ||
#define mp_hal_ticks_cpu() 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2020 The Pybricks Authors | ||
// Copyright (c) 2018-2021 The Pybricks Authors | ||
|
||
#include <contiki.h> | ||
#include <pbdrv/clock.h> | ||
|
||
void mp_hal_set_interrupt_char(int c); | ||
#define mp_hal_ticks_ms clock_time | ||
#define mp_hal_ticks_us clock_usecs | ||
#define mp_hal_delay_us clock_delay_usec | ||
#define mp_hal_ticks_ms pbdrv_clock_get_ms | ||
#define mp_hal_ticks_us pbdrv_clock_get_us | ||
#define mp_hal_ticks_cpu() 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2020 The Pybricks Authors | ||
// Copyright (c) 2018-2021 The Pybricks Authors | ||
|
||
#include "sys/clock.h" | ||
#include <pbdrv/clock.h> | ||
|
||
void mp_hal_set_interrupt_char(int c); | ||
#define mp_hal_ticks_ms clock_time | ||
#define mp_hal_ticks_us clock_usecs | ||
#define mp_hal_delay_us clock_delay_usec | ||
#define mp_hal_ticks_ms pbdrv_clock_get_ms | ||
#define mp_hal_ticks_us pbdrv_clock_get_us | ||
#define mp_hal_ticks_cpu() 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2020 The Pybricks Authors | ||
// Copyright (c) 2018-2021 The Pybricks Authors | ||
|
||
#include <contiki.h> | ||
#include <pbdrv/clock.h> | ||
|
||
void mp_hal_set_interrupt_char(int c); | ||
#define mp_hal_ticks_ms clock_time | ||
#define mp_hal_ticks_us clock_usecs | ||
#define mp_hal_delay_us clock_delay_usec | ||
#define mp_hal_ticks_ms pbdrv_clock_get_ms | ||
#define mp_hal_ticks_us pbdrv_clock_get_us | ||
#define mp_hal_ticks_cpu() 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2020 The Pybricks Authors | ||
// Copyright (c) 2018-2021 The Pybricks Authors | ||
|
||
#include <contiki.h> | ||
#include <pbdrv/clock.h> | ||
|
||
void mp_hal_set_interrupt_char(int c); | ||
#define mp_hal_ticks_ms clock_time | ||
#define mp_hal_ticks_us clock_usecs | ||
#define mp_hal_delay_us clock_delay_usec | ||
#define mp_hal_ticks_ms pbdrv_clock_get_ms | ||
#define mp_hal_ticks_us pbdrv_clock_get_us | ||
#define mp_hal_ticks_cpu() 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2020 The Pybricks Authors | ||
// Copyright (c) 2018-2021 The Pybricks Authors | ||
|
||
#include "sys/clock.h" | ||
#include <pbdrv/clock.h> | ||
|
||
void mp_hal_set_interrupt_char(int c); | ||
#define mp_hal_ticks_ms clock_time | ||
#define mp_hal_ticks_us clock_usecs | ||
#define mp_hal_delay_us clock_delay_usec | ||
#define mp_hal_ticks_ms pbdrv_clock_get_ms | ||
#define mp_hal_ticks_us pbdrv_clock_get_us | ||
#define mp_hal_ticks_cpu() 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2020 The Pybricks Authors | ||
// Copyright (c) 2018-2021 The Pybricks Authors | ||
|
||
#include <contiki.h> | ||
#include <pbdrv/clock.h> | ||
|
||
void mp_hal_set_interrupt_char(int c); | ||
#define mp_hal_ticks_ms clock_time | ||
#define mp_hal_ticks_us clock_usecs | ||
#define mp_hal_delay_us clock_delay_usec | ||
#define mp_hal_ticks_ms pbdrv_clock_get_ms | ||
#define mp_hal_ticks_us pbdrv_clock_get_us | ||
#define mp_hal_ticks_cpu() 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.