Commit graph

67 commits

Author SHA1 Message Date
Joakim Eriksson d980c0db16 added delays in CC2420 to avoid risk of configuring before CC2420 is powered on 2011-06-05 00:20:25 +02:00
Joakim Eriksson 77ec0bfa0f fixed the z1 platform and generic code used by z1 to work with IAR compiler 2011-05-25 17:21:51 +02:00
Joakim Eriksson d8e54ca585 fixed for compilation with IAR compiler 2011-04-06 20:14:30 +02:00
Lionel Debroux 5cb49e8b07 Several compiler warning fixes:
* msp430: fix "implicit declaration of function" warnings in clock.c, by including watchdog.h;
     * sky: fix a couple pointer target signedness warnings;
     * core: fix several signed/unsigned comparison warnings;
     * framer-802154: "const static" -> "static const" to fix compiler warnings;
     * core: comment or remove unused variables and function definitions.

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Signed-off-by: Mariano Alvira <mar@devl.org>
2011-02-20 19:28:14 -05:00
adamdunkels cea299d79a Call upper layers even if packet reception failed - this allows the RDC layer to shut off the radio even if a malformed packet was received. 2011-01-09 21:09:28 +00:00
adamdunkels d267b5ca94 Re-added timestamp support for outbound packets that was removed when switching to the new radio API 2010-12-16 22:40:52 +00:00
adamdunkels 433d42e170 Bugfix: if the cc2420_cca() function wasn't able to turn on the radio properly, it should turn it off again if it was off before. 2010-12-05 00:14:24 +00:00
nifi e242fb28bf Reverted radio API change in CC2420 (not yet fully integrated with Contiki core) 2010-09-23 08:26:06 +00:00
adamdunkels 40ee35e8c8 Rewrote all busy waits with a new macro, which has a built-in timeout to ensure that busy waits won't hang the CPU 2010-09-22 22:01:53 +00:00
nifi 3e6113be72 removed debug output 2010-06-30 09:03:20 +00:00
nifi 49a2ca6b1e Fixed naming of CC2420 macros 2010-06-24 09:28:38 +00:00
joxe f7a82a9145 split SPI code into generic and CC2420-related and renamed constants in CC2420 2010-06-23 10:15:28 +00:00
joxe bc398ca546 removed platform dependent loop-count from cc2420 - moved to platform config instead 2010-06-21 19:48:00 +00:00
joxe a5d7b197eb added support for the Z1 platform and its 8Mhz 2010-06-21 19:09:35 +00:00
adamdunkels 3fa8ffda1a Moved the modules packetbuf, queuebuf, and packetqueue from net/rime to net/, since they are not Rime-specific 2010-06-14 19:19:16 +00:00
nifi 14b1bb9f57 Fixed to only use leds when DEBUG is set 2010-04-20 11:41:16 +00:00
adamdunkels 3670fac618 Bugfix: timing fixed 2010-04-08 18:23:24 +00:00
adamdunkels be117afe04 After a lot of tweaking and twiddling with the timing of the ContikiMAC code and the mechanisms in the CC2420 driver, things seem to work somewhat stable now - knock on wood! 2010-04-04 07:49:30 +00:00
adamdunkels a637ddaf4e Flush the rxfifo when turning off the radio instead of when turning it on. This seems to fix a bug that was seen in mspsim and seemed to appear on real hardware too. 2010-04-03 16:01:00 +00:00
adamdunkels c9ca5d61e2 Rewrote the pending_packet() function to check the FIFOP pin instead of the 'pending' variable - works must better on real hardware and is now supported by the latest mspsim 2010-03-31 19:08:56 +00:00
adamdunkels 5e7f99a2c0 Reverted the removal of the code that checked the FIFOP pin before reading a packet - checking FIFOP is the correct way to do it. Also added TXONCCA for now, including new radio.h return values to indicate a link-layer collision. 2010-03-30 23:00:05 +00:00
adamdunkels a3a8c0e179 Safety check: only try to read a packet if it was preceeded by an interrupt (which sets the pending flag) 2010-03-19 13:18:53 +00:00
adamdunkels 67b0170a43 Bugfix: don't care about FIFOP when reading a packet; if the radio rx had been turned off before a packet was read, FIFOP would be zero and the packet would be trashed 2010-03-16 18:10:09 +00:00
adamdunkels 0035a70537 Reworked the locking code, which seems to fix a few bugs caused by the interaction with contikimac. Contikimac performs a CCA check in a preempting rtimer, which requires underlying code to properly call the GET_LOCK() macro. This fix seems to solve most problems, but there may be others left. 2010-03-14 22:45:20 +00:00
joxe 1214b1fa40 made cc2420 panid and short address not dependent on endianness 2010-03-09 15:45:29 +00:00
adamdunkels cc7d3ae142 Reset CCA mode to default. Make sure that the radio gto switched on when reading RSSI; otherwise node will reboot because of watchdog 2010-03-09 13:18:16 +00:00
adamdunkels b9827d2b36 Bugfix: didn't correctly reset the pending flag when a packet was read from the radio 2010-02-25 16:06:44 +00:00
adamdunkels 1ee32c3074 Removed non-functional time synchronization code; added some experimental code for CCA checks (enabled CCA mode 1, a temporary development function for setting the CCA threshold); enable the possibility to switch off radio even if a packet is currently arriving 2010-02-23 18:24:49 +00:00
adamdunkels 0b2b7bcdba Removed inadvertedly left-over include file 2010-02-18 23:52:34 +00:00
adamdunkels e34eb54960 A work-in-progress rework of the Contiki MAC and radio layers. The
main ideas are:

* Separates the Contiki low-layer network stack into four layers:
  network (e.g. sicslowpan / rime), Medium Access Control MAC
  (e.g. CSMA), Radio Duty Cycling RDC (e.g. ContikiMAC, X-MAC), and
  radio (e.g. cc2420).
* Introduces a new way to configure the network stack. Four #defines
  that specify what mechanism/protocol/driver to use at the four
  layers: NETSTACK_CONF_NETWORK, NETSTACK_CONF_MAC, NETSTACK_CONF_RDC,
  NETSTACK_CONF_RADIO.
* Adds a callback mechanism to inform the MAC and network layers about
  the fate of a transmitted packet: if the packet was not possible to
  transmit, the cause of the failure is reported, and if the packets
  was successfully transmitted, the number of tries before it was
  finally transmitted is reported.
* NULL-protocols at both the MAC and RDC layers: nullmac and nullrdc,
  which can be used when MAC and RDC functionality is not needed.
* Extends the radio API with three new functions that enable more
  efficient radio duty cycling protocols: channel check, pending
  packet, and receiving packet.
* New initialization mechanism, which takes advantage of the NETSTACK
  #defines.
2010-02-18 21:48:39 +00:00
adamdunkels fab672c7ba Reverted the FIFOP->FIFO change; it didn't work :( 2010-01-14 23:32:05 +00:00
zhitao 93c748cc74 Bug fix for mysterious packet loss : check FIFO pin instead of FIFOP pin for any unread RX FIFO data;
Added protection of packet timestamp across interrupts. Note that race condition can still occur as interrupts and self-scheduled reads of the RX FIFO interleave in certain unusual patterns. More investigation is needed.
2009-12-11 18:32:54 +00:00
fros4943 9cc57c4324 generic radio return values
+ minor bug fix: SFD may go high without transmission starting (very seldom)
2009-11-13 10:07:53 +00:00
adamdunkels 8745235a79 Minor codestyle fix 2009-09-09 21:07:42 +00:00
nifi c81dbb6c89 Fixed problem with the radio driver changing transmission power to max when not specified at transmission. Also fixed bug where the lock was released when setting the transmission power.
Thanks to Djamel Djenouri and Marcus Lundén for identifying the problem.
2009-08-19 15:05:05 +00:00
fros4943 18a98bb573 bug fix: we need to explicitly turn off the cc2420 listen mode after a packet transmission 2009-08-19 12:00:04 +00:00
joxe 0c8b200987 added autoack configuration for CC2420 and reversed long ieee address for address recognition 2009-07-28 22:24:53 +00:00
adamdunkels 92862ad2a5 Increased the number of iterations for ugly-hack-loop that checks if a transmission has started, to accommodate a faster CPU speed on the MSP430 2009-04-29 11:38:50 +00:00
adamdunkels 65eb5fd4e8 Renamed the rimebuf module to packetbuf to signal that the module is used outside of a pure Rime context (e.g., the sicslowpan code uses it). 2009-03-12 21:58:20 +00:00
adamdunkels f634ccfb3d Set transmission power based on packet attribute 2009-03-11 20:38:53 +00:00
adamdunkels 57b9cab27e Set RSSI, correlation, and timestamp as packet attributes for incoming packets 2009-03-02 21:59:01 +00:00
nifi dee785ae88 added configuration of checksum and timesynch 2009-02-25 21:21:06 +00:00
adamdunkels 6a460fecdd There is problem with the CC2420 driver: under high traffic load the packets often get mangled in the receive FIFO. Not sure why this happens or how to best prevent it. As a temporary workaround, I've added an additional CRC16 check to the incoming packets. This eats two bytes from each packet, but at least protects against the erroneous packets we've seen quite a few of lately. The reception code was also cleaned up, which resulted in a smaller code size. 2008-08-26 21:44:03 +00:00
adamdunkels 66876625d4 Changed name of the simple-cc2420 module to cc2420: changed all function names and variable names from simple_cc2420_* to cc2420_*. 2008-07-02 09:05:40 +00:00
adamdunkels 1586d8f36f Changed filename of the CC2420 driver from simple-cc2420 to cc2420. 2008-07-01 21:02:51 +00:00
adamdunkels 39abed8672 Moved old CC2420 driver to the backyard 2008-02-24 22:29:08 +00:00
bg- 70ddc0f27e * If we detect a RXFIFO overflow schedule a poll of the device driver. 2007-07-30 14:54:49 +00:00
bg- 8f0d9aab89 * Change max life of neigbour entries from 60 to 30 seconds by
changing the time unit (quanta) from 4 to 2 seconds.
2007-06-28 15:08:53 +00:00
bg- 08d547780c * Some extra delay when broadcasting to break potential symmetries. 2007-06-01 14:37:02 +00:00
bg- 81b684414d * Changed implementation for dealing with retransmissions to be
strictly event driven. The old implementation was rather process
  like and the new one is still implemented as a process.
2007-05-31 10:15:57 +00:00