Skip to content

Timer configuration for interruptless mode #50

Open
@gergoerdi

Description

@gergoerdi

I'd like to configure a timer for CTC mode with polling instead of interrupts. Unfortunately, this is not possible at the moment because setting the comparator target is coupled with turning on interrupts:

    pub fn configure(self) {
        T::ControlA::write(self.a);
        T::ControlB::write(self.b);
        T::ControlC::write(self.c);

        // Reset counter to zero
        T::Counter::write(0u16);

        if let Some(v) = self.output_compare_1 {
            // Set the match
            T::CompareA::write(v);

            // Enable compare interrupt
            T::InterruptMask::set(T::OCIEA);
        }
    }

I think these should be exposed as two orthogonal features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions