updated for latest mac driver structure

This commit is contained in:
fros4943 2008-11-12 12:42:41 +00:00
parent 229d60d691
commit e42d572f81
2 changed files with 17 additions and 14 deletions

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: tdma_mac.c,v 1.4 2008/02/24 22:10:30 adamdunkels Exp $ * $Id: tdma_mac.c,v 1.5 2008/11/12 12:42:41 fros4943 Exp $
*/ */
#include "contiki.h" #include "contiki.h"
@ -226,7 +226,7 @@ off(void)
return radio->off(); return radio->off();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void const struct mac_driver *
tdma_mac_init(const struct radio_driver *d) tdma_mac_init(const struct radio_driver *d)
{ {
int i; int i;
@ -237,12 +237,15 @@ tdma_mac_init(const struct radio_driver *d)
radio = d; radio = d;
radio->set_receive_function(input); radio->set_receive_function(input);
radio->on(); radio->on();
return &tdma_mac_driver;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
const struct mac_driver tdma_mac_driver = { const struct mac_driver tdma_mac_driver = {
send, "TDMA MAC",
read, send,
set_receive_function, read,
on, set_receive_function,
off, on,
off,
}; };

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: tdma_mac.h,v 1.1 2007/08/31 13:42:22 fros4943 Exp $ * $Id: tdma_mac.h,v 1.2 2008/11/12 12:42:41 fros4943 Exp $
*/ */
#ifndef __TDMA_MAC_H__ #ifndef __TDMA_MAC_H__
@ -39,6 +39,6 @@
extern const struct mac_driver tdma_mac_driver; extern const struct mac_driver tdma_mac_driver;
void tdma_mac_init(const struct radio_driver *r); const struct mac_driver * tdma_mac_init(const struct radio_driver *r);
#endif /* __TDMA_MAC_H__ */ #endif /* __TDMA_MAC_H__ */