joajfreitas / fcp-core

MIT License
6 stars 1 forks source link

Support for period/frequency #104

Closed ItsNotSoftware closed 2 weeks ago

ItsNotSoftware commented 1 month ago

Option 1

struct Pedals {
    acc_pos @0: u8 | unit("%"),
    brake_pos @1: u8 | unit("%"),
}

impl can for Pedals {
    id: 10,
    device: "ecu",
    period: 15, /* Period in milliseconds*/

    signal brake_pos {
        bitstart: 16,
    },
}

Option 2

struct Pedals {
    acc_pos @0: u8 | unit("%"),
    brake_pos @1: u8 | unit("%"),
}

impl can for Pedals {
    id: 10,
    device: "ecu",
    frequency: 15, /* Frequency in Hz*/

    signal brake_pos {
        bitstart: 16,
    },
}
joajfreitas commented 1 month ago

Decisions, decisions.

I would like to point out that comments as the ones after the frequency: and period: fields are not supported 😲.