mirror of
				https://github.com/manuelbl/ttn-esp32.git
				synced 2025-10-31 10:40:35 +01:00 
			
		
		
		
	Upgrade to version 3.3 of arduino-lmic
This commit is contained in:
		| @ -34,9 +34,9 @@ | ||||
| // This should be defined elsewhere | ||||
| void lmic_aes_encrypt(u1_t *data, u1_t *key); | ||||
|  | ||||
| // global area for passing parameters (aux, key) and for storing round keys | ||||
| // global area for passing parameters (aux, key) | ||||
| u4_t AESAUX[16/sizeof(u4_t)]; | ||||
| u4_t AESKEY[11*16/sizeof(u4_t)]; | ||||
| u4_t AESKEY[16/sizeof(u4_t)]; | ||||
|  | ||||
| // Shift the given buffer left one bit | ||||
| static void shift_left(xref2u1_t buf, u1_t len) { | ||||
|  | ||||
| @ -187,9 +187,17 @@ | ||||
| #endif | ||||
|  | ||||
| // LMIC_ENABLE_long_messages | ||||
| // LMIC certification requires that this be enabled. | ||||
| #if !defined(LMIC_ENABLE_long_messages) | ||||
| # define LMIC_ENABLE_long_messages 1        /* PARAM */ | ||||
| // LMIC certification requires full-length 255 frames, but to save RAM, | ||||
| // a shorter maximum can be set. This controls both RX and TX buffers, | ||||
| // so reducing this by 1 saves 2 bytes of RAM. | ||||
| #if defined(LMIC_ENABLE_long_messages) && defined(LMIC_MAX_FRAME_LENGTH) | ||||
| #error "Use only one of LMIC_ENABLE_long_messages or LMIC_MAX_FRAME_LENGTH" | ||||
| #elif defined(LMIC_ENABLE_long_messages) && LMIC_ENABLE_long_messages == 0 | ||||
| # define LMIC_MAX_FRAME_LENGTH 64 | ||||
| #elif !defined(LMIC_MAX_FRAME_LENGTH) | ||||
| # define LMIC_MAX_FRAME_LENGTH 255 | ||||
| #elif LMIC_MAX_FRAME_LENGTH > 255 | ||||
| #error "LMIC_MAX_FRAME_LENGTH cannot be larger than 255" | ||||
| #endif | ||||
|  | ||||
| // LMIC_ENABLE_event_logging | ||||
|  | ||||
| @ -105,7 +105,7 @@ extern "C"{ | ||||
| #define ARDUINO_LMIC_VERSION_CALC(major, minor, patch, local)	\ | ||||
| 	((((major)*UINT32_C(1)) << 24) | (((minor)*UINT32_C(1)) << 16) | (((patch)*UINT32_C(1)) << 8) | (((local)*UINT32_C(1)) << 0)) | ||||
|  | ||||
| #define	ARDUINO_LMIC_VERSION	ARDUINO_LMIC_VERSION_CALC(3, 2, 0, 0)	/* v3.2.0 */ | ||||
| #define	ARDUINO_LMIC_VERSION	ARDUINO_LMIC_VERSION_CALC(3, 3, 0, 0)	/* v3.3.0 */ | ||||
|  | ||||
| #define	ARDUINO_LMIC_VERSION_GET_MAJOR(v)	\ | ||||
| 	((((v)*UINT32_C(1)) >> 24u) & 0xFFu) | ||||
|  | ||||
| @ -60,7 +60,7 @@ enum { ILLEGAL_RPS = 0xFF }; | ||||
|  | ||||
| // Global maximum frame length | ||||
| enum { STD_PREAMBLE_LEN  =  8 }; | ||||
| enum { MAX_LEN_FRAME     =  LMIC_ENABLE_long_messages ? 255 : 64 }; | ||||
| enum { MAX_LEN_FRAME     =  LMIC_MAX_FRAME_LENGTH }; | ||||
| enum { LEN_DEVNONCE      =  2 }; | ||||
| enum { LEN_ARTNONCE      =  3 }; | ||||
| enum { LEN_NETID         =  3 }; | ||||
|  | ||||
| @ -382,6 +382,7 @@ static void writeReg (u1_t addr, u1_t data ) { | ||||
|     hal_spi_write(addr | 0x80, &data, 1); | ||||
| } | ||||
|  | ||||
| // ttn-esp32: it's safer if buffer is static | ||||
| static u1_t reg_value_buf[1]; | ||||
|  | ||||
| static u1_t readReg (u1_t addr) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user