1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-28 07:51:19 +01:00

Merge pull request #5239 from OlegHahm/cpuid_smaller_8

driver: assure required buffer size
This commit is contained in:
Oleg Hahm 2016-04-04 16:30:52 +02:00
commit 53f33c435b
2 changed files with 10 additions and 0 deletions

View File

@ -51,7 +51,12 @@ void at86rf2xx_setup(at86rf2xx_t *dev, const at86rf2xx_params_t *params)
void at86rf2xx_reset(at86rf2xx_t *dev)
{
#if CPUID_LEN
/* make sure that the buffer is always big enough to store a 64bit value */
# if CPUID_LEN < IEEE802154_LONG_ADDRESS_LEN
uint8_t cpuid[IEEE802154_LONG_ADDRESS_LEN];
# else
uint8_t cpuid[CPUID_LEN];
#endif
eui64_t addr_long;
#endif

View File

@ -395,7 +395,12 @@ int kw2xrf_init(kw2xrf_t *dev, spi_t spi, spi_speed_t spi_speed,
uint8_t tmp[2];
kw2xrf_gpio_int = int_pin;
#if CPUID_LEN
/* make sure that the buffer is always big enough to store a 64bit value */
# if CPUID_LEN < IEEE802154_LONG_ADDRESS_LEN
uint8_t cpuid[IEEE802154_LONG_ADDRESS_LEN];
# else
uint8_t cpuid[CPUID_LEN];
#endif
eui64_t addr_long;
#endif