commit 26dead12185b7721d47c45900bebd6dda6ff4ea7
Author: Cung Sang <csang@techfak.uni-bielefeld.de>
Date:   Tue Feb 12 11:20:39 2019 +0100

    DW1000 LLD updated

diff --git a/include/DW1000/v1/deca_instance_v1.h b/include/DW1000/v1/deca_instance_v1.h
index b78c820..e800c50 100755
--- a/include/DW1000/v1/deca_instance_v1.h
+++ b/include/DW1000/v1/deca_instance_v1.h
@@ -151,16 +151,6 @@ extern "C" {
 #define RX_RESPONSE1_TURNAROUND_6M81 (300) //takes about 100 us for response to come back
 #define RX_RESPONSE1_TURNAROUND_110K (300) //takes about 100 us for response to come back
 
-  /* For TAG HAL F1 */
-  //#define RX_RESPONSE1_TURNAROUND (200) //takes about 200 us for the 1st response to come back (from A0)
-  //#define RX_RESPONSE1_TURNAROUND_6M81 (300) //takes about 100 us for response to come back
-  //#define RX_RESPONSE1_TURNAROUND_110K (18700) //takes about 100 us for response to come back
-
-  /* For ANCHOR HAL F1 */
-  //#define RX_RESPONSE1_TURNAROUND (300) //takes about 200 us for the 1st response to come back (from A0)
-  //#define RX_RESPONSE1_TURNAROUND_6M81 (300) //takes about 100 us for response to come back
-  //#define RX_RESPONSE1_TURNAROUND_110K (4700) //takes about 100 us for response to come back
-
   //Tag will range to 3 or 4 anchors
   //Each ranging exchange will consist of minimum of 3 messages (Poll, Response, Final)
   //and a maximum of 6 messages (Poll, Response x 4, Final)
@@ -248,7 +238,7 @@ extern "C" {
     uint8_t fcs[2] ;                              	//  125-126  we allow space for the CRC as it is logically part of the message. However ScenSor TX calculates and adds these bytes.
   } srd_msg_dssl ;
 
-  typedef struct
+  typedef struct  __attribute__((packed))
   {
     uint8_t channelNumber ;       // valid range is 1 to 11
     uint8_t preambleCode ;        // 00 = use NS code, 1 to 24 selects code
@@ -279,7 +269,7 @@ extern "C" {
   //in turn and the event queued up before the instance processed the TX event.
 #define MAX_EVENT_NUMBER (6)
 
-  typedef struct
+  typedef struct  __attribute__((packed))
   {
     uint8_t  type;			// event type - if 0 there is no event in the queue
     uint8_t  type_save;		// holds the event type - does not clear (used to show what event has been processed)
@@ -307,10 +297,10 @@ extern "C" {
     uint8_t gotit;			//stores the instance function which processed the event (used for debug)
   }event_data_t ;
 
-extern event_data_t dw_event_g;   // TODO
+extern event_data_t dw_event_g;
 
   // TX power and PG delay configuration structure
-  typedef struct {
+  typedef struct  __attribute__((packed)) {
     uint8_t PGdelay;
 
     //TX POWER
@@ -321,7 +311,7 @@ extern event_data_t dw_event_g;   // TODO
     uint32_t txPwr[2]; //
   }tx_struct;
 
-  typedef struct
+  typedef struct __attribute__((packed))
   {
     INST_MODE mode;				//instance mode (tag or anchor)
 
@@ -426,7 +416,7 @@ extern event_data_t dw_event_g;   // TODO
     int newRange;			//flag set when there is a new range to report TOF_REPORT_A2A or TOF_REPORT_T2A
     int newRangeAncAddress; //last 4 bytes of anchor address - used for printing/range output display
     int newRangeTagAddress; //last 4 bytes of tag address - used for printing/range output display
-    int newRangeTime;
+    uint32_t newRangeTime;
 
     uint8_t gatewayAnchor ; //set to TRUE = 1 if anchor address == GATEWAY_ANCHOR_ADDR
 
@@ -470,8 +460,7 @@ extern event_data_t dw_event_g;   // TODO
   void instance_close(void);
   // Call init, then call config, then call run. call close when finished
   // initialise the instance (application) structures and DW1000 device
-//  int instance_init(void);
-  int instance_init(DW1000Driver* drv);     //TODO
+  int instance_init(DW1000Driver* drv);
 
   // configure the instance and DW1000 device
   void instance_config(instanceConfig_t *config, sfConfig_t *sfconfig, DW1000Driver* drv) ;
@@ -490,7 +479,6 @@ extern event_data_t dw_event_g;   // TODO
   // configure TX/RX callback functions that are called from DW1000 ISR
   void instance_rxcallback(const dwt_cb_data_t *rxd);
   void instance_txcallback(const dwt_cb_data_t *txd);
-  /*TODO: add callbacks */
   void instance_rxtimeoutcallback(const dwt_cb_data_t *rxd);
   void instance_rxerrorcallback(const dwt_cb_data_t *rxd);
 
@@ -525,7 +513,7 @@ extern event_data_t dw_event_g;   // TODO
   int instancenewrangetagadd(void);
   int instancenewrangepolltim(void);
   int instancenewrange(void);
-  int instancenewrangetim(void);
+  uint32_t instancenewrangetim(void);
 
   uint64_t convertmicrosectodevicetimeu (double microsecu);
   double convertdevicetimetosec(int32_t dt);
@@ -562,9 +550,6 @@ extern event_data_t dw_event_g;   // TODO
 
   void instance_notify_DW1000_inIDLE(int idle);
 
-
-  // TODO: The following Functions are added in user applciation (previously on the API )
-
   double dwt_getrangebias(uint8_t chan, float range, uint8_t prf);
 
   uint32_t dwt_getotptxpower(uint8_t prf, uint8_t chan);
@@ -573,10 +558,6 @@ extern event_data_t dw_event_g;   // TODO
 
   uint16_t dwt_readantennadelay(uint8_t prf);
 
-
-  /* End of user application functions (Previously on API) */
-
-
   // configure TX power
   void instanceconfigtxpower(uint32_t txpower);
   void instancesettxpower(void);
