ARM: introduce sei() and cli().
No test, because it's tricky to test, but it compiles and the firmware still works as before.
This commit is contained in:
parent
608506719b
commit
7be5212f06
34
cpu.h
34
cpu.h
|
|
@ -2,6 +2,40 @@
|
|||
#ifndef _CPU_H
|
||||
#define _CPU_H
|
||||
|
||||
#if defined __AVR__
|
||||
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
#elif defined __ARMEL__
|
||||
|
||||
#include "cmsis-lpc11xx.h" // For __ASM().
|
||||
|
||||
/** Enable interrupts.
|
||||
|
||||
This enables interrupts by clearing the I-bit in the CPSR.
|
||||
|
||||
Code copied from MBED, __enable_irq(), in file
|
||||
mbed/libraries/mbed/targets/cmsis/core_cmFunc.h.
|
||||
*/
|
||||
static void sei(void) __attribute__ ((always_inline));
|
||||
inline void sei(void) {
|
||||
__ASM volatile ("cpsie i" ::: "memory");
|
||||
}
|
||||
|
||||
/** Disable interrupts.
|
||||
|
||||
This disables interrupts by setting the I-bit in the CPSR.
|
||||
|
||||
Code copied from MBED, __disable_irq(), in file
|
||||
mbed/libraries/mbed/targets/cmsis/core_cmFunc.h.
|
||||
*/
|
||||
static void cli(void) __attribute__ ((always_inline));
|
||||
inline void cli(void) {
|
||||
__ASM volatile ("cpsid i" ::: "memory");
|
||||
}
|
||||
|
||||
#endif /* __AVR__, __ARMEL__ */
|
||||
|
||||
void cpu_init(void);
|
||||
|
||||
#endif /* _CPU_H */
|
||||
|
|
|
|||
4
dda.c
4
dda.c
|
|
@ -7,14 +7,12 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#ifdef __AVR__
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
|
||||
#include "dda_maths.h"
|
||||
#include "preprocessor_math.h"
|
||||
#include "dda_kinematics.h"
|
||||
#include "dda_lookahead.h"
|
||||
#include "cpu.h"
|
||||
#include "timer.h"
|
||||
#include "serial.h"
|
||||
#include "sermsg.h"
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#ifdef __AVR__
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
|
||||
#include "config_wrapper.h"
|
||||
#include "timer.h"
|
||||
|
|
@ -17,6 +14,7 @@
|
|||
#include "delay.h"
|
||||
#include "sersendf.h"
|
||||
#include "clock.h"
|
||||
#include "cpu.h"
|
||||
#include "memory_barrier.h"
|
||||
|
||||
/// movebuffer head pointer. Points to the last move in the queue.
|
||||
|
|
|
|||
|
|
@ -5,12 +5,10 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#ifdef __AVR__
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
|
||||
#include "gcode_parse.h"
|
||||
|
||||
#include "cpu.h"
|
||||
#include "dda.h"
|
||||
#include "dda_queue.h"
|
||||
#include "watchdog.h"
|
||||
|
|
|
|||
|
|
@ -4,15 +4,10 @@
|
|||
\brief motherboard <-> extruder board protocol
|
||||
*/
|
||||
|
||||
#ifdef __AVR__
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
#include "memory_barrier.h"
|
||||
|
||||
#include "config_wrapper.h"
|
||||
#include "pinio.h"
|
||||
#include "delay.h"
|
||||
#include "memory_barrier.h"
|
||||
|
||||
#if (defined TEMP_INTERCOM) || (defined EXTRUDER)
|
||||
#define INTERCOM_BAUD 57600
|
||||
|
|
|
|||
2
mendel.c
2
mendel.c
|
|
@ -114,10 +114,12 @@ void init(void) {
|
|||
#ifdef SD
|
||||
sd_init();
|
||||
#endif
|
||||
#endif /* __ARMEL_NOTYET__ */
|
||||
|
||||
// enable interrupts
|
||||
sei();
|
||||
|
||||
#ifndef __ARMEL_NOTYET__
|
||||
// reset watchdog
|
||||
wd_reset();
|
||||
#endif /* __ARMEL_NOTYET__ */
|
||||
|
|
|
|||
6
timer.c
6
timer.c
|
|
@ -10,15 +10,13 @@
|
|||
Teacup has tried numerous timer management methods, and this is the best so far.
|
||||
*/
|
||||
|
||||
#ifdef __AVR__
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
#include "memory_barrier.h"
|
||||
|
||||
#include "arduino.h"
|
||||
#include "config_wrapper.h"
|
||||
#include "pinio.h"
|
||||
#include "clock.h"
|
||||
#include "cpu.h"
|
||||
#include "memory_barrier.h"
|
||||
|
||||
#ifdef MOTHERBOARD
|
||||
#include "dda_queue.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue