Commit graph

154 commits

Author SHA1 Message Date
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
4d5f112960 New return value for invidating a link-layer collision 2010-03-30 23:00:22 +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
nifi
ea090a60e6 Fixed to call the SLIP callback function also when using IPv6 2010-03-17 07:10:25 +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
nifi
55e0fec37e * Changed to write keys to CC2420 RAM big-endian order
* Fixed cc2420_aes_cipher() to wait for encryption to finish before reading result
2010-03-15 23:04:54 +00:00
nifi
e834562455 * Fixed FASTSPI_READ_RAM_LE to wait for tx end before reading
* Added FASTSPI_WRITE_RAM_BE to write to RAM (big-endian order)
2010-03-15 23:01:37 +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
nifi
58c55340ed fixed to work with IPv6 2010-03-10 22:30:39 +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
4b04fdd328 Minor style fix 2010-02-23 18:26:26 +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
5292005962 A null radio driver that does not do anything - useful in the native port and as a template for new radio drivers 2010-02-23 18:18:53 +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
e455ef3533 Added the battery indicator to the sensors API 2010-01-15 08:51:21 +00:00
adamdunkels
fab672c7ba Reverted the FIFOP->FIFO change; it didn't work :( 2010-01-14 23:32:05 +00:00
adamdunkels
53edff7655 Added sensor API for the SHT11 driver 2010-01-14 20:16:33 +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
adamdunkels
6815e2a53f Code style fix 2009-12-05 11:26:20 +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
fros4943
26bb5ecd21 added radio and MAC generic return values to allow applications finding out whether the packet was transmitted 2009-11-13 08:59:22 +00:00
fros4943
5f71e9914e configurable line buffer size + simplified interrupt handler + overflow check on line buffer 2009-11-02 12:47:06 +00:00
fros4943
6f4a537aa0 serial line ringbuf implementation + increased default buffer size to 128 bytes 2009-10-27 16:20:31 +00:00
adamdunkels
8745235a79 Minor codestyle fix 2009-09-09 21:07:42 +00:00
nifi
d4b619bcc5 Renamed SPI_WAITFOREOTxBUF to SPI_WAITFORTxREADY for clarity and generalized SPI transmission status checks to work with both AVR and MSP430 2009-09-07 11:31:26 +00:00
nifi
3a8ee769cb Changed to monitor the UART transmitter buffer ready flag instead of the UART transmitter empty flag. This almost doubles the speed of transmitting data to CC2420. Patch by James Brown. 2009-08-31 12:06:34 +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
joxe
a71664e8d1 quick fix for driver to work with 4MHz 2009-06-23 13:12:37 +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
nifi
a3777852d4 * Corrected address for setting key 1
* Added missing include
2009-04-07 09:22:58 +00:00
adamdunkels
0076bfe8a5 Changed the name of the 'serial' module to 'serial-line' to signify that the module is about lines of data from the serial port, not individual bytes, and to make sdcc happy 2009-03-17 15:56:32 +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
e34e97cd6f Minor code style fixes 2009-02-24 21:30:20 +00:00