Skip to content

Conversation

@mysterywolf
Copy link
Member

@mysterywolf mysterywolf commented Jan 8, 2023

参考:https://github.com/Jojo-1000/micropin/blob/master/micropin/Interrupts.hpp

void loop(void)
{
    rt_kprintf("----\n");
    noInterrupts();
    rt_kprintf("context!\n");
    interrupts();
    rt_kprintf("----\n");
    /* put your main code here, to run repeatedly: */
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));

    delay(100);
}

image

@mysterywolf mysterywolf merged commit 3ab4c93 into master Jan 8, 2023
@mysterywolf mysterywolf deleted the interrupt branch January 8, 2023 06:07
@mysterywolf mysterywolf changed the title 使用class noInterrupts的方式实现关中断 通过类构造/析构重新实现noInterrupts/interrupts() Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants