summaryrefslogtreecommitdiff
path: root/atmel-samd/samdneopixel.c
diff options
context:
space:
mode:
authorTony DiCola <tony@tonydicola.com>2016-10-13 04:59:43 +0000
committerTony DiCola <tony@tonydicola.com>2016-10-13 04:59:43 +0000
commit903bc8d04edef0e60fd755e8b9e46ef6a8ec2584 (patch)
treee2273674fa85bb3f848abbf20eb1ca50d1562f15 /atmel-samd/samdneopixel.c
parent011056af15f6107b9ef35fdf19a3f715b55f55d5 (diff)
atmel-samd: Implement time.ticks_ms function using SysTick timer, add global interrupt enable/disable functions.
Diffstat (limited to 'atmel-samd/samdneopixel.c')
-rw-r--r--atmel-samd/samdneopixel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/atmel-samd/samdneopixel.c b/atmel-samd/samdneopixel.c
index 70b27aee7..e271de046 100644
--- a/atmel-samd/samdneopixel.c
+++ b/atmel-samd/samdneopixel.c
@@ -1,6 +1,8 @@
#include "asf/common2/services/delay/delay.h"
#include "asf/sam0/drivers/port/port.h"
+#include "mphalport.h"
+
#include "samdneopixel.h"
void samd_neopixel_write(uint32_t pin, uint8_t *pixels, uint32_t numBytes, bool is800KHz) {
@@ -11,7 +13,7 @@ void samd_neopixel_write(uint32_t pin, uint8_t *pixels, uint32_t numBytes, bool
PortGroup* port;
// Turn off interrupts of any kind during timing-sensitive code.
- irqflags_t flags = cpu_irq_save();
+ mp_hal_disable_all_interrupts();
port = port_get_group_from_gpio_pin(pin);
pinMask = (1UL << (pin % 32)); // From port_pin_set_output_level ASF code.
@@ -78,7 +80,7 @@ void samd_neopixel_write(uint32_t pin, uint8_t *pixels, uint32_t numBytes, bool
}
// Turn on interrupts after timing-sensitive code.
- cpu_irq_restore(flags);
+ mp_hal_enable_all_interrupts();
// 50ms delay to let pixels latch to the data that was just sent.
// This could be optimized to only occur before pixel writes when necessary,