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

cpu/rpx0xx: add periph timer #16627

Merged
merged 2 commits into from
Aug 9, 2021
Merged

Conversation

fabian18
Copy link
Contributor

@fabian18 fabian18 commented Jul 8, 2021

Contribution description

This PR contributes a periph_timer driver implementation for the RP2040 MCU.

Testing procedure

tests/periph_timer_periodic:

2021-07-08 14:57:32,736 # START
2021-07-08 14:57:32,743 # main(): This is RIOT! (Version: 2021.10-devel-27-g732dc-cpu_rp2040_periph_timer)
2021-07-08 14:57:32,743 # 
2021-07-08 14:57:32,746 # Running Timer 0 at 1000000 Hz.
2021-07-08 14:57:32,749 # One counter cycle is 25000 ticks or 25 ms
2021-07-08 14:57:32,752 # Will print 'tick' every cycle.
2021-07-08 14:57:32,752 # 
2021-07-08 14:57:32,752 # TEST START
2021-07-08 14:57:32,779 # [0] tick
2021-07-08 14:57:32,803 # [0] tick
2021-07-08 14:57:32,830 # [0] tick
2021-07-08 14:57:32,856 # [0] tick
2021-07-08 14:57:32,881 # [0] tick
2021-07-08 14:57:32,907 # [0] tick
2021-07-08 14:57:32,933 # [0] tick
2021-07-08 14:57:32,958 # [0] tick
2021-07-08 14:57:32,984 # [0] tick
2021-07-08 14:57:33,010 # [0] tick
2021-07-08 14:57:33,036 # [0] tick
2021-07-08 14:57:33,061 # [0] tick
2021-07-08 14:57:33,061 # 
2021-07-08 14:57:33,062 # Cycles:
2021-07-08 14:57:33,063 # channel 0 = 12        [OK]
2021-07-08 14:57:33,065 # TEST SUCCEEDED

tests/periph_timer:

2021-07-08 14:58:18,177 # START
2021-07-08 14:58:18,184 # main(): This is RIOT! (Version: 2021.10-devel-27-g732dc-cpu_rp2040_periph_timer)
2021-07-08 14:58:18,185 # 
2021-07-08 14:58:18,187 # Test for peripheral TIMERs
2021-07-08 14:58:18,187 # 
2021-07-08 14:58:18,189 # Available timers: 1
2021-07-08 14:58:18,189 # 
2021-07-08 14:58:18,190 # Testing TIMER_0:
2021-07-08 14:58:18,193 # TIMER_0: initialization successful
2021-07-08 14:58:18,195 # TIMER_0: stopped
2021-07-08 14:58:18,197 # TIMER_0: set channel 0 to 5000
2021-07-08 14:58:18,200 # TIMER_0: set channel 1 to 10000
2021-07-08 14:58:18,203 # TIMER_0: set channel 2 to 15000
2021-07-08 14:58:18,206 # TIMER_0: set channel 3 to 20000
2021-07-08 14:58:18,207 # TIMER_0: starting
2021-07-08 14:58:18,232 # TIMER_0: channel 0 fired at SW count    59902 - init:    59902
2021-07-08 14:58:18,237 # TIMER_0: channel 1 fired at SW count   119653 - diff:    59751
2021-07-08 14:58:18,243 # TIMER_0: channel 2 fired at SW count   179554 - diff:    59901
2021-07-08 14:58:18,248 # TIMER_0: channel 3 fired at SW count   239461 - diff:    59907
2021-07-08 14:58:18,249 # 
2021-07-08 14:58:18,250 # TEST SUCCEEDED

tests/periph_timer_short_relative_set:

2021-07-08 14:59:29,875 # START
2021-07-08 14:59:29,882 # main(): This is RIOT! (Version: 2021.10-devel-27-g732dc-cpu_rp2040_periph_timer)
2021-07-08 14:59:29,882 # 
2021-07-08 14:59:29,886 # Test for peripheral TIMER short timer_set()
2021-07-08 14:59:29,886 # 
2021-07-08 14:59:29,891 # This test tries timer_set() with decreasing intervals down to 0.
2021-07-08 14:59:29,898 # You should see lines like 'interval <n> ok', followed by a success message.
2021-07-08 14:59:29,902 # On failure, this test prints an error message.
2021-07-08 14:59:29,902 # 
2021-07-08 14:59:29,905 # testing periph_timer 0, freq 1000000
2021-07-08 14:59:29,906 # interval 99 ok
2021-07-08 14:59:29,908 # interval 98 ok
2021-07-08 14:59:29,909 # interval 97 ok
2021-07-08 14:59:29,910 # interval 96 ok
2021-07-08 14:59:29,912 # interval 95 ok
2021-07-08 14:59:29,913 # interval 94 ok
2021-07-08 14:59:29,914 # interval 93 ok
2021-07-08 14:59:29,916 # interval 92 ok
2021-07-08 14:59:29,917 # interval 91 ok
2021-07-08 14:59:29,918 # interval 90 ok
2021-07-08 14:59:29,920 # interval 89 ok
2021-07-08 14:59:29,921 # interval 88 ok
2021-07-08 14:59:29,922 # interval 87 ok
2021-07-08 14:59:29,923 # interval 86 ok
2021-07-08 14:59:29,925 # interval 85 ok
2021-07-08 14:59:29,927 # interval 84 ok
2021-07-08 14:59:29,927 # interval 83 ok
2021-07-08 14:59:29,929 # interval 82 ok
2021-07-08 14:59:29,930 # interval 81 ok
2021-07-08 14:59:29,931 # interval 80 ok
2021-07-08 14:59:29,933 # interval 79 ok
2021-07-08 14:59:29,934 # interval 78 ok
2021-07-08 14:59:29,935 # interval 77 ok
2021-07-08 14:59:29,937 # interval 76 ok
2021-07-08 14:59:29,938 # interval 75 ok
2021-07-08 14:59:29,939 # interval 74 ok
2021-07-08 14:59:29,940 # interval 73 ok
2021-07-08 14:59:29,942 # interval 72 ok
2021-07-08 14:59:29,943 # interval 71 ok
2021-07-08 14:59:29,945 # interval 70 ok
2021-07-08 14:59:29,946 # interval 69 ok
2021-07-08 14:59:29,947 # interval 68 ok
2021-07-08 14:59:29,948 # interval 67 ok
2021-07-08 14:59:29,950 # interval 66 ok
2021-07-08 14:59:29,951 # interval 65 ok
2021-07-08 14:59:29,952 # interval 64 ok
2021-07-08 14:59:29,953 # interval 63 ok
2021-07-08 14:59:29,955 # interval 62 ok
2021-07-08 14:59:29,956 # interval 61 ok
2021-07-08 14:59:29,957 # interval 60 ok
2021-07-08 14:59:29,959 # interval 59 ok
2021-07-08 14:59:29,960 # interval 58 ok
2021-07-08 14:59:29,961 # interval 57 ok
2021-07-08 14:59:29,963 # interval 56 ok
2021-07-08 14:59:29,965 # interval 55 ok
2021-07-08 14:59:29,966 # interval 54 ok
2021-07-08 14:59:29,966 # interval 53 ok
2021-07-08 14:59:29,968 # interval 52 ok
2021-07-08 14:59:29,969 # interval 51 ok
2021-07-08 14:59:29,970 # interval 50 ok
2021-07-08 14:59:29,972 # interval 49 ok
2021-07-08 14:59:29,973 # interval 48 ok
2021-07-08 14:59:29,974 # interval 47 ok
2021-07-08 14:59:29,976 # interval 46 ok
2021-07-08 14:59:29,977 # interval 45 ok
2021-07-08 14:59:29,978 # interval 44 ok
2021-07-08 14:59:29,980 # interval 43 ok
2021-07-08 14:59:29,981 # interval 42 ok
2021-07-08 14:59:29,982 # interval 41 ok
2021-07-08 14:59:29,983 # interval 40 ok
2021-07-08 14:59:29,985 # interval 39 ok
2021-07-08 14:59:29,986 # interval 38 ok
2021-07-08 14:59:29,987 # interval 37 ok
2021-07-08 14:59:29,989 # interval 36 ok
2021-07-08 14:59:29,990 # interval 35 ok
2021-07-08 14:59:29,992 # interval 34 ok
2021-07-08 14:59:29,993 # interval 33 ok
2021-07-08 14:59:29,994 # interval 32 ok
2021-07-08 14:59:29,995 # interval 31 ok
2021-07-08 14:59:29,996 # interval 30 ok
2021-07-08 14:59:29,998 # interval 29 ok
2021-07-08 14:59:29,999 # interval 28 ok
2021-07-08 14:59:30,000 # interval 27 ok
2021-07-08 14:59:30,002 # interval 26 ok
2021-07-08 14:59:30,003 # interval 25 ok
2021-07-08 14:59:30,004 # interval 24 ok
2021-07-08 14:59:30,006 # interval 23 ok
2021-07-08 14:59:30,008 # interval 22 ok
2021-07-08 14:59:30,009 # interval 21 ok
2021-07-08 14:59:30,010 # interval 20 ok
2021-07-08 14:59:30,011 # interval 19 ok
2021-07-08 14:59:30,012 # interval 18 ok
2021-07-08 14:59:30,013 # interval 17 ok
2021-07-08 14:59:30,015 # interval 16 ok
2021-07-08 14:59:30,016 # interval 15 ok
2021-07-08 14:59:30,017 # interval 14 ok
2021-07-08 14:59:30,019 # interval 13 ok
2021-07-08 14:59:30,020 # interval 12 ok
2021-07-08 14:59:30,021 # interval 11 ok
2021-07-08 14:59:30,022 # interval 10 ok
2021-07-08 14:59:30,024 # interval 9 ok
2021-07-08 14:59:30,025 # interval 8 ok
2021-07-08 14:59:30,026 # interval 7 ok
2021-07-08 14:59:30,027 # interval 6 ok
2021-07-08 14:59:30,029 # interval 5 ok
2021-07-08 14:59:30,030 # interval 4 ok
2021-07-08 14:59:30,031 # interval 3 ok
2021-07-08 14:59:30,032 # interval 2 ok
2021-07-08 14:59:30,033 # interval 1 ok
2021-07-08 14:59:30,035 # interval 0 ok
2021-07-08 14:59:30,035 # 
2021-07-08 14:59:30,036 # TEST SUCCEEDED

Issues/PRs references

Depends on #16609

@github-actions github-actions bot added Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration labels Jul 8, 2021
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

Looks very good. Some comments inline.

*/

/**
* @ingroup cpu_rp2040
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @ingroup cpu_rp2040
* @ingroup cpu_rpx0xx

}
/* The timer must run at 1000000 Hz (µs precision)
because the number of cycles per µs is shared with the watchdog.
The reference clock (clk_ref) is devided by WATCHDOG->TICK.bits.CYCLES
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The reference clock (clk_ref) is devided by WATCHDOG->TICK.bits.CYCLES
The reference clock (clk_ref) is divided by WATCHDOG->TICK.bits.CYCLES

* @brief Configuration type of a timer channel
*/
typedef struct {
IRQn_Type irqn; /** timer channel interrupt number */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
IRQn_Type irqn; /** timer channel interrupt number */
IRQn_Type irqn; /**< timer channel interrupt number */

Comment on lines 403 to 405
TIMER_Type *dev; /** pointer to timer base address */
const timer_channel_conf_t *ch; /** pointer to timer channel configuration */
uint8_t chn; /** number of timer channels */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
TIMER_Type *dev; /** pointer to timer base address */
const timer_channel_conf_t *ch; /** pointer to timer channel configuration */
uint8_t chn; /** number of timer channels */
TIMER_Type *dev; /**< pointer to timer base address */
const timer_channel_conf_t *ch; /**< pointer to timer channel configuration */
uint8_t chn; /**< number of timer channels */

Comment on lines 48 to 51
do {
time_h = tmp;
time_l = TIMER->TIMERAWL;
} while ((tmp = TIMER->TIMERAWH) != time_h);
Copy link
Member

Choose a reason for hiding this comment

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

If I understand the datasheet correctly, it would be better to read from registers TIMELR and TIMEHR. To my understanding a read from TIMELR causes the raw time value from TIMERAWH to be copied into TIMEHR simultaneously while reading the raw least significant time word. Hence, a subsequent read from TIMEHR will contain the value of TIMERAWH at the time TIMELR was read, so that the looping is not needed.

However, an those reads should be wrapped into irq_disable() and irq_restore(), as an interrupting thread also reading the time could still mess with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The SDK does not do it that way because of the second core. But since we are only running on core 0, we could certainly just read TIMELR and then TIMEHR.

cpu/rpx0xx/periph/timer.c Show resolved Hide resolved
cpu/rpx0xx/periph/timer.c Show resolved Hide resolved
Comment on lines 144 to 149
unsigned state = irq_disable();
_timer_disable_periodic(dev, channel);
/* an alarm interrupt matches on the lower 32 bit of the 64 bit timer counter */
uint64_t target = DEV(dev)->TIMERAWL + timeout;
*ALARM(dev, channel) = (uint32_t)target;
irq_restore(state);
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't it happen that on a value of timeout = 0 this has to value for almost a full period, if the clock tick happens between line 147 and 148?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to force the timer interrupt to trigger if timeout == 0.

if (!timeout) {
    io_reg_atomic_set(&DEV(dev)->INTF.reg, 1U << channel);
}

But that did not work. When the line executes gdb showed:

(gdb) 
target not halted
target rp2040.cpu was not halted when step was requested
CMSIS-DAP command mismatch. Expected 0x5 received 0x0

and the program freezed.

Is it ok to execute the callback immediately?

    if (!timeout) {
        if (_timer_ctx_cb[dev]) {
            _timer_ctx_cb[dev](_timer_ctx_arg[dev], channel);
        }
    }

@maribu
Copy link
Member

maribu commented Jul 14, 2021

Care to rebase and squash?

@github-actions github-actions bot removed Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration labels Jul 14, 2021
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 18, 2021
@benpicco
Copy link
Contributor

CI is not happy yet

@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Jul 27, 2021
@fabian18
Copy link
Contributor Author

Building application "tests_pkg_flatbuffers" for "rpi-pico" with MCU "rpx0xx".

rm -rf /tmp/dwq.0.12608149732274465/fa3616a9a42e33e62055f6de0feb46ad/build/pkg-build/flatbuffers
[INFO] cloning flatbuffers
git-cache: cloning from cache. tag=592c204500d79f46bdf5f225c3de82f69e87b50f/v1.11.0
[INFO] updating flatbuffers /tmp/dwq.0.12608149732274465/fa3616a9a42e33e62055f6de0feb46ad/build/pkg/flatbuffers/.pkg-state.git-downloaded
echo v1.11.0 > /tmp/dwq.0.12608149732274465/fa3616a9a42e33e62055f6de0feb46ad/build/pkg/flatbuffers/.pkg-state.git-downloaded
[INFO] patch flatbuffers
In file included from ../../boards/rpi-pico/include/periph_conf.h:25,
                 from ../../boards/rpi-pico/include/board.h:23,
                 from ../include/xtimer.h:46,
                 from condition_variable.cpp:28:
../../cpu/rpx0xx/include/periph_cpu.h: In function 'void gpio_set_pad_config(uint8_t, gpio_pad_ctrl_t)':
../../cpu/rpx0xx/include/periph_cpu.h:442:58: error: passing 'volatile gpio_pad_ctrl_t' as 'this' argument discards qualifiers [-fpermissive]
  442 |     *(volatile gpio_pad_ctrl_t*)gpio_pad_register(pin) = config;
      |                                                          ^~~~~~
../../cpu/rpx0xx/include/periph_cpu.h:299:3: note:   in call to 'gpio_pad_ctrl_t& gpio_pad_ctrl_t::operator=(const gpio_pad_ctrl_t&)'
  299 | } gpio_pad_ctrl_t;
      |   ^~~~~~~~~~~~~~~
../../cpu/rpx0xx/include/periph_cpu.h: In function 'void gpio_set_io_config(uint8_t, gpio_io_ctrl_t)':
../../cpu/rpx0xx/include/periph_cpu.h:459:56: error: passing 'volatile gpio_io_ctrl_t' as 'this' argument discards qualifiers [-fpermissive]
  459 |     *(volatile gpio_io_ctrl_t*)gpio_io_register(pin) = config;
      |                                                        ^~~~~~
../../cpu/rpx0xx/include/periph_cpu.h:390:3: note:   in call to 'gpio_io_ctrl_t& gpio_io_ctrl_t::operator=(const gpio_io_ctrl_t&)'
  390 | } gpio_io_ctrl_t;

This error disappears without volatile in the cast.
I don´t know if it is required and it seems unrelated to me.

@fabian18
Copy link
Contributor Author

--- build output of app tests/periph_gpio for board rpi-pico:gnu (raw, runtime=0.5s):
-- running on worker mobi6.inet.haw-hamburg.de-11 thread 1, build number 33439.
make: Entering directory '/tmp/dwq.0.520311222406695/a1fff56c0807a1f7bcca63b09caf7071/tests/periph_gpio'
Building application "tests_periph_gpio" for "rpi-pico" with MCU "rpx0xx".

main.c: In function 'enable_int':
main.c:158:9: error: variable 'po' set but not used [-Werror=unused-but-set-variable]
  158 |     int po, pi;
      |  

It complains that port is unused, because of

#define GPIO_PIN(port, pin)     (pin)

A fix could be:

#define GPIO_PIN(port, pin)     ((((port) & 0)) | (pin))

@maribu
Copy link
Member

maribu commented Jul 27, 2021

This error disappears without volatile in the cast.

This could result in the compiler optimizing out the store, as it would be unaware that the store has side effects.

The issue is that the C++ compiler is interpreting the C code as C++ code.

I think something like this could work for both C and C++:

diff --git a/cpu/rpx0xx/include/periph_cpu.h b/cpu/rpx0xx/include/periph_cpu.h
index 1f0ea78122..87803d12e0 100644
--- a/cpu/rpx0xx/include/periph_cpu.h
+++ b/cpu/rpx0xx/include/periph_cpu.h
@@ -416,7 +416,7 @@ static inline volatile uint32_t * gpio_pad_register(uint8_t pin)
  */
 static inline void gpio_set_pad_config(uint8_t pin, gpio_pad_ctrl_t config)
 {
-    *(volatile gpio_pad_ctrl_t*)gpio_pad_register(pin) = config;
+    *(volatile gpio_pad_ctrl_t*)gpio_pad_register(pin) = (volatile gpio_pad_ctrl_t)config;
 }
 
 /**

@fabian18
Copy link
Contributor Author

This error disappears without volatile in the cast.

This could result in the compiler optimizing out the store, as it would be unaware that the store has side effects.

The issue is that the C++ compiler is interpreting the C code as C++ code.

I think something like this could work for both C and C++:

diff --git a/cpu/rpx0xx/include/periph_cpu.h b/cpu/rpx0xx/include/periph_cpu.h
index 1f0ea78122..87803d12e0 100644
--- a/cpu/rpx0xx/include/periph_cpu.h
+++ b/cpu/rpx0xx/include/periph_cpu.h
@@ -416,7 +416,7 @@ static inline volatile uint32_t * gpio_pad_register(uint8_t pin)
  */
 static inline void gpio_set_pad_config(uint8_t pin, gpio_pad_ctrl_t config)
 {
-    *(volatile gpio_pad_ctrl_t*)gpio_pad_register(pin) = config;
+    *(volatile gpio_pad_ctrl_t*)gpio_pad_register(pin) = (volatile gpio_pad_ctrl_t)config;
 }
 
 /**

C++ keeps being picky about it.
Nor do

static inline void gpio_set_pad_config(uint8_t pin, volatile gpio_pad_ctrl_t config)
{
    *(volatile gpio_pad_ctrl_t *)gpio_pad_register(pin) = config;
}

and

static inline void gpio_set_pad_config(uint8_t pin, gpio_pad_ctrl_t config)
{
    *(volatile gpio_pad_ctrl_t *)gpio_pad_register(pin) = *(volatile gpio_pad_ctrl_t *)&config;
}

work out.
But this also pleases C++ and volatile stays.

static inline void gpio_set_pad_config(uint8_t pin, gpio_pad_ctrl_t config)
{
    uint32_t *c = (uint32_t *)&config;
    *gpio_pad_register(pin) = *c;
}

I guess because operator= cannot be overloaded for uint32_t.

@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 27, 2021
@benpicco
Copy link
Contributor

Kconfig still needs an update

@github-actions github-actions bot added the Area: Kconfig Area: Kconfig integration label Jul 28, 2021
@fabian18
Copy link
Contributor Author

May I rebase and squash?

@benpicco
Copy link
Contributor

benpicco commented Aug 6, 2021

Is there something missing here?
The code looks good!

@maribu
Copy link
Member

maribu commented Aug 6, 2021

Is there something missing here?

Only an ACK. I will give the tests another spin later today and then I can provide an ACK, assuming the tests still pass.

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

ACK. One variable naming suggestion. Please squash right in, if you take it.

$ make BOARD=rpi-pico -C tests/periph_timer flash test:

READY
s
START
main(): This is RIOT! (Version: 2021.10-devel-254-gee535f-fabian)

Test for peripheral TIMERs

Available timers: 1

Testing TIMER_0:
TIMER_0: initialization successful
TIMER_0: stopped
TIMER_0: set channel 0 to 5000
TIMER_0: set channel 1 to 10000
TIMER_0: set channel 2 to 15000
TIMER_0: set channel 3 to 20000
TIMER_0: starting
TIMER_0: channel 0 fired at SW count    59908 - init:    59908
TIMER_0: channel 1 fired at SW count   119659 - diff:    59751
TIMER_0: channel 2 fired at SW count   179561 - diff:    59902
TIMER_0: channel 3 fired at SW count   239467 - diff:    59906

TEST SUCCEEDED

$ make BOARD=rpi-pico -C tests/periph_timer_periodic flash test

READY
s
START
main(): This is RIOT! (Version: 2021.10-devel-254-gee535f-fabian)

Running Timer 0 at 1000000 Hz.
One counter cycle is 25000 ticks or 25 ms
Will print 'tick' every cycle.

TEST START
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick

Cycles:
channel 0 = 12	[OK]
TEST SUCCEEDED

$ make BOARD=rpi-pico -C tests/periph_timer_short_relative_set flash test

READY
s
START
main(): This is RIOT! (Version: 2021.10-devel-254-gee535f-fabian)

Test for peripheral TIMER short timer_set()

This test tries timer_set() with decreasing intervals down to 0.
You should see lines like 'interval <n> ok', followed by a success message.
On failure, this test prints an error message.

testing periph_timer 0, freq 1000000
interval 99 ok
interval 98 ok
interval 97 ok
interval 96 ok
interval 95 ok
interval 94 ok
interval 93 ok
interval 92 ok
interval 91 ok
interval 90 ok
interval 89 ok
interval 88 ok
interval 87 ok
interval 86 ok
interval 85 ok
interval 84 ok
interval 83 ok
interval 82 ok
interval 81 ok
interval 80 ok
interval 79 ok
interval 78 ok
interval 77 ok
interval 76 ok
interval 75 ok
interval 74 ok
interval 73 ok
interval 72 ok
interval 71 ok
interval 70 ok
interval 69 ok
interval 68 ok
interval 67 ok
interval 66 ok
interval 65 ok
interval 64 ok
interval 63 ok
interval 62 ok
interval 61 ok
interval 60 ok
interval 59 ok
interval 58 ok
interval 57 ok
interval 56 ok
interval 55 ok
interval 54 ok
interval 53 ok
interval 52 ok
interval 51 ok
interval 50 ok
interval 49 ok
interval 48 ok
interval 47 ok
interval 46 ok
interval 45 ok
interval 44 ok
interval 43 ok
interval 42 ok
interval 41 ok
interval 40 ok
interval 39 ok
interval 38 ok
interval 37 ok
interval 36 ok
interval 35 ok
interval 34 ok
interval 33 ok
interval 32 ok
interval 31 ok
interval 30 ok
interval 29 ok
interval 28 ok
interval 27 ok
interval 26 ok
interval 25 ok
interval 24 ok
interval 23 ok
interval 22 ok
interval 21 ok
interval 20 ok
interval 19 ok
interval 18 ok
interval 17 ok
interval 16 ok
interval 15 ok
interval 14 ok
interval 13 ok
interval 12 ok
interval 11 ok
interval 10 ok
interval 9 ok
interval 8 ok
interval 7 ok
interval 6 ok
interval 5 ok
interval 4 ok
interval 3 ok
interval 2 ok
interval 1 ok
interval 0 ok

TEST SUCCEEDED

I ran the last test 33 times as this one has a stochastic element with 100% success rate.

typedef struct {
TIMER_Type *dev; /**< pointer to timer base address */
const timer_channel_conf_t *ch; /**< pointer to timer channel configuration */
uint8_t chn; /**< number of timer channels */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
uint8_t chn; /**< number of timer channels */
uint8_t ch_numof; /**< number of timer channels */

The postfix numof is commonly used within RIOT's code base, maybe use it here as well for consistency?

@fabian18
Copy link
Contributor Author

fabian18 commented Aug 9, 2021

I have added your naming suggestion and rebased to the master branch

@fabian18
Copy link
Contributor Author

fabian18 commented Aug 9, 2021

Thank You @benpicco and @maribu

@benpicco benpicco added this to the Release 2021.10 milestone Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants