!yafYEipFNsXDdwiHMT:matrix.org

RTIC - The hardware accelerated RTOS

647 Members
Welcome to the chat room for RTIC, the hardware accelerated RTOS written in Rust! | Documentation: https://rtic.rs/ | Discuss, coordinate, help: https://github.com/rtic-rs | Meeting-notes: https://rtic.rs/meeting | Code of conduct: https://www.rust-lang.org/conduct.html72 Servers

Load older messages


SenderMessageTime
27 Mar 2023
@korken89:matrix.orgkorken89It generates an interrupt on every tick16:16:22
@korken89:matrix.orgkorken89Other monotonics generates interrupts when it's the right time for something to happen16:16:42
@korken89:matrix.orgkorken89So if your do something with 1s interval you'll get one interrupt per second16:18:27
@korken89:matrix.orgkorken89While the systick with generate 999 extra than what is needed16:18:50
@korken89:matrix.orgkorken89It does extremely little, so at 1000 Hz it's not noticable really, but good to know16:19:19
@korken89:matrix.orgkorken89 Félix the Newbie: ^ 16:19:41
@korken89:matrix.orgkorken89If i have no low power requirements, and don't need smaller times than an milliseconds i use the systick generally16:20:37
@korken89:matrix.orgkorken89For everything else a timer based monotonic :)16:21:05
@korken89:matrix.orgkorken89And if low power is high on the list, an RTC based one16:21:55
@korken89:matrix.orgkorken89Afk, I'm going away until ~21 swedish time :)16:26:21
@rtic-bot:matrix.orgrtic-bot

New PR: build(deps): update syn requirement from 1.0.107 to 2.0.10

17:06:47
@rtic-bot:matrix.orgrtic-bot

PR closed without merging: build(deps): update syn requirement from 1.0.107 to 2.0.3

17:06:51
@boiethios:matrix.orgFélix the Newbie
In reply to @korken89:matrix.org
And if low power is high on the list, an RTC based one
I'd like to ask you a few things, but I don't want to spam this chat. Do you prefer to go PM?
18:24:00
@kulst:matrix.orgkulst joined the room.20:35:26
28 Mar 2023
@korken89:matrix.orgkorken89
In reply to @boiethios:matrix.org
I'd like to ask you a few things, but I don't want to spam this chat. Do you prefer to go PM?
Both are fine with me:)
03:57:13
@boiethios:matrix.orgFélix the Newbie
In reply to @korken89:matrix.org
Both are fine with me:)

Thank you! I was thinking about something like that:

pub trait TimeoutHandler {
    type Handle;

    /// Returns a new handle for a new timeout countdown.
    fn create(&mut self, ready_in: u64) -> Self::Handle;
    /// Returns weither the given timeout has elapsed or not.
    fn elapsed(&self, handle: Self::Handle) -> bool;
}

But the issue is that, IIUC, the tasks are always a function in the app, so I cannot move the receiver around (typically in the timeout handler). How would you do that? Maybe my trait isn't designed correctly.

07:25:45
@korken89:matrix.orgkorken89Hmm I'm not sure I'm following what you're trying to do07:51:20
@boiethios:matrix.orgFélix the NewbieAn abstraction in my library so that the user can implement a timeout mechanism that I can use in my library. I don't want to tie it directly to RTIC, but I want it to be usable with RTIC.07:53:56
@boiethios:matrix.orgFélix the NewbieTo put it otherly: I need a timeout mechanism in my library, but it's the user's job to provide it (with RTIC behind the curtain)07:55:38
@boiethios:matrix.orgFélix the NewbieAlso, a single timeout handler must be able to manage several timeouts at once.07:58:40
@korken89:matrix.orgkorken89 Then I'd recommend to use the async-embedded-hal feature flag and use that delay 08:42:23
@korken89:matrix.orgkorken89You can then select on the delay and your operation, and have a completely generic impl08:42:42
@korken89:matrix.orgkorken89 * Then I'd recommend to use the embedded-hal-async feature flag and use that delay 08:43:11
@korken89:matrix.orgkorken89Fore example this enables this part: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics/src/rp2040.rs#L12408:43:37
@korken89:matrix.orgkorken89 Félix the Newbie: ^ 08:43:42
@korken89:matrix.orgkorken89Then you don't need to make your own trait08:44:06
@korken89:matrix.orgkorken89 * Then you don't need to make your own trait as well08:44:18
@boiethios:matrix.orgFélix the Newbie
In reply to @korken89:matrix.org
Then I'd recommend to use the embedded-hal-async feature flag and use that delay
Sorry for my answer delay, unfortunately, I'm not paid for playing with embedded Rust, so my priority is my actual job 😅
I'm not sure to understand what that DelayUs is used for: isn't that an API to pause the current execution flow?
BTW I didn't know it was possible to have async fn in traits.
19:11:53
@boiethios:matrix.orgFélix the Newbie Also, I wanted to create an abstraction not tied to any hardware, so doesn't it defeat my goal to use embedded_hal_async? 19:13:18
@boiethios:matrix.orgFélix the Newbie
In reply to @korken89:matrix.org
Then I'd recommend to use the embedded-hal-async feature flag and use that delay
* Sorry for my answer delay, unfortunately, I'm not paid for playing with embedded Rust, so my priority is my actual job 😅
I'm not sure to understand what that DelayUs is used for: isn't that an API to pause the current execution flow? I don't understand how it can help me to implement a timeout, since the execution is stuck at that point.
BTW I didn't know it was possible to have async fn in traits.
19:18:11

There are no newer messages yet.


Back to Room ListRoom Version: 4