code for bitmasks sanitzed

This commit is contained in:
cyberman54 2020-12-24 16:52:07 +01:00
parent a30eab54f7
commit 71ae40c260
2 changed files with 29 additions and 26 deletions

View File

@ -18,25 +18,28 @@
#include "mallocator.h" #include "mallocator.h"
#include <bsec.h> #include <bsec.h>
#define _bit(b) (1U << (b))
#define _bitl(b) (1UL << (b))
// bits in payloadmask for filtering payload data // bits in payloadmask for filtering payload data
#define COUNT_DATA (0x01) #define COUNT_DATA _bit(1)
#define ALARM_DATA (0x02) #define ALARM_DATA _bit(2)
#define MEMS_DATA (0x04) #define MEMS_DATA _bit(3)
#define GPS_DATA (0x08) #define GPS_DATA _bit(4)
#define SENSOR1_DATA (0x10) #define SENSOR1_DATA _bit(5)
#define SENSOR2_DATA (0x20) #define SENSOR2_DATA _bit(6)
#define SENSOR3_DATA (0x40) #define SENSOR3_DATA _bit(7)
#define BATT_DATA (0x80) #define BATT_DATA _bit(8)
// bits in configmask for device runmode control // bits in configmask for device runmode control
#define GPS_MODE (0x01) #define GPS_MODE _bit(1)
#define ALARM_MODE (0x02) #define ALARM_MODE _bit(2)
#define BEACON_MODE (0x04) #define BEACON_MODE _bit(3)
#define UPDATE_MODE (0x08) #define UPDATE_MODE _bit(4)
#define FILTER_MODE (0x10) #define FILTER_MODE _bit(5)
#define ANTENNA_MODE (0x20) #define ANTENNA_MODE _bit(6)
#define BLE_MODE (0x40) #define BLE_MODE _bit(7)
#define SCREEN_MODE (0x80) #define SCREEN_MODE _bit(8)
// length of display buffer for lmic event messages // length of display buffer for lmic event messages
#define LMIC_EVENTMSG_LEN 17 #define LMIC_EVENTMSG_LEN 17

View File

@ -1,16 +1,16 @@
#ifndef _IRQHANDLER_H #ifndef _IRQHANDLER_H
#define _IRQHANDLER_H #define _IRQHANDLER_H
#define DISPLAY_IRQ 0x001 #define DISPLAY_IRQ _bitl(1)
#define BUTTON_IRQ 0x002 #define BUTTON_IRQ _bitl(2)
#define SENDCYCLE_IRQ 0x004 #define SENDCYCLE_IRQ _bitl(3)
#define CYCLIC_IRQ 0x008 #define CYCLIC_IRQ _bitl(4)
#define TIMESYNC_IRQ 0x010 #define TIMESYNC_IRQ _bitl(5)
#define MASK_IRQ 0x020 #define MASK_IRQ _bitl(6)
#define UNMASK_IRQ 0x040 #define UNMASK_IRQ _bitl(7)
#define BME_IRQ 0x080 #define BME_IRQ _bitl(8)
#define MATRIX_DISPLAY_IRQ 0x100 #define MATRIX_DISPLAY_IRQ _bitl(9)
#define PMU_IRQ 0x200 #define PMU_IRQ _bitl(10)
#include "globals.h" #include "globals.h"
#include "button.h" #include "button.h"