*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
#include <ao.h>
#include <ao_radio_cmac.h>
-static __xdata uint8_t ao_radio_cmac_mutex;
-__pdata int8_t ao_radio_cmac_rssi;
-static __xdata uint8_t cmac_data[AO_CMAC_MAX_LEN + AO_CMAC_KEY_LEN + 2 + AO_CMAC_KEY_LEN];
+static uint8_t ao_radio_cmac_mutex;
+int8_t ao_radio_cmac_rssi;
+static uint8_t cmac_data[AO_CMAC_MAX_LEN + AO_CMAC_KEY_LEN + 2 + AO_CMAC_KEY_LEN];
static uint8_t
round_len(uint8_t len)
len = AO_CMAC_KEY_LEN;
rem = len % AO_CMAC_KEY_LEN;
if (rem != 0)
- len += (AO_CMAC_KEY_LEN - rem);
+ len += (uint8_t) (AO_CMAC_KEY_LEN - rem);
return len;
}
* Sign and deliver the data sitting in the cmac buffer
*/
static void
-radio_cmac_send(uint8_t len) __reentrant
+radio_cmac_send(uint8_t len)
{
uint8_t i;
*/
static int8_t
-radio_cmac_recv(uint8_t len, uint16_t timeout) __reentrant
+radio_cmac_recv(uint8_t len, AO_TICK_TYPE timeout)
{
uint8_t i;
}
int8_t
-ao_radio_cmac_send(__xdata void *packet, uint8_t len) __reentrant
+ao_radio_cmac_send(void *packet, uint8_t len)
{
if (len > AO_CMAC_MAX_LEN)
return AO_RADIO_CMAC_LEN_ERROR;
ao_mutex_get(&ao_radio_cmac_mutex);
- ao_xmemcpy(cmac_data, packet, len);
+ memcpy(cmac_data, packet, len);
#if AO_LED_TX
ao_led_on(AO_LED_TX);
#endif
}
int8_t
-ao_radio_cmac_recv(__xdata void *packet, uint8_t len, uint16_t timeout) __reentrant
+ao_radio_cmac_recv(void *packet, uint8_t len, AO_TICK_TYPE timeout)
{
int8_t i;
if (len > AO_CMAC_MAX_LEN)
ao_led_off(AO_LED_RX);
#endif
if (i == AO_RADIO_CMAC_OK)
- ao_xmemcpy(packet, cmac_data, len);
+ memcpy(packet, cmac_data, len);
ao_mutex_put(&ao_radio_cmac_mutex);
return i;
}