mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-21 21:58:05 -06:00
generic: Move simulator/irq.h to new file generic/irq.h
Move the generic irq definitions into generic/irq.h and move the simulator irq code into main.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
9f8817a47e
commit
73f3b0636a
4 changed files with 46 additions and 34 deletions
|
@ -7,10 +7,42 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "board/misc.h" // timer_from_us
|
||||
#include "board/irq.h" // irq_disable
|
||||
#include "sched.h" // sched_main
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Interrupts
|
||||
****************************************************************/
|
||||
|
||||
uint8_t Interrupt_off;
|
||||
|
||||
void irq_disable(void)
|
||||
{
|
||||
Interrupt_off = 1;
|
||||
barrier();
|
||||
}
|
||||
|
||||
void irq_enable(void)
|
||||
{
|
||||
barrier();
|
||||
Interrupt_off = 0;
|
||||
}
|
||||
|
||||
uint8_t irq_save(void)
|
||||
{
|
||||
uint8_t flag = Interrupt_off;
|
||||
irq_disable();
|
||||
return flag;
|
||||
}
|
||||
|
||||
void irq_restore(uint8_t flag)
|
||||
{
|
||||
barrier();
|
||||
Interrupt_off = flag;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Timers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue