summaryrefslogtreecommitdiff
path: root/libraries/MultiLCD/hardware/arm/HW_ARM_defines.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/MultiLCD/hardware/arm/HW_ARM_defines.h')
-rw-r--r--libraries/MultiLCD/hardware/arm/HW_ARM_defines.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libraries/MultiLCD/hardware/arm/HW_ARM_defines.h b/libraries/MultiLCD/hardware/arm/HW_ARM_defines.h
index 2881e17..8df5f97 100644
--- a/libraries/MultiLCD/hardware/arm/HW_ARM_defines.h
+++ b/libraries/MultiLCD/hardware/arm/HW_ARM_defines.h
@@ -15,8 +15,13 @@
//********************************************************************
// *** Hardwarespecific defines ***
-#define cbi(reg, bitmask) *reg &= ~bitmask
-#define sbi(reg, bitmask) *reg |= bitmask
+#if defined(ENERGIA)
+ #define cbi(reg, bitmask) HWREG((uint32_t)reg + 0x3FC) &= ~bitmask
+ #define sbi(reg, bitmask) HWREG((uint32_t)reg + 0x3FC) |= bitmask
+#else
+ #define cbi(reg, bitmask) *reg &= ~bitmask
+ #define sbi(reg, bitmask) *reg |= bitmask
+#endif
#define pulse_high(reg, bitmask) sbi(reg, bitmask); cbi(reg, bitmask);
#define pulse_low(reg, bitmask) cbi(reg, bitmask); sbi(reg, bitmask);