From df2c831088a6d3f11ad7427e844f7249cb9700a9 Mon Sep 17 00:00:00 2001 From: Grygoriy Fuchedzhy Date: Sun, 10 Jan 2010 14:09:50 +0200 Subject: [PATCH] setting extended address during init replaced with setting short address --- fw/mrf/mrf.h | 3 --- fw/mrf/mrf_impl.h | 9 ++++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fw/mrf/mrf.h b/fw/mrf/mrf.h index 328fb36..c36645c 100644 --- a/fw/mrf/mrf.h +++ b/fw/mrf/mrf.h @@ -23,9 +23,6 @@ #include #include -#include -extern prog_uint8_t mrf_ext_addr[MRF_EXT_ADDR_LENGTH]; - uint8_t mrf_read_short_addr(uint8_t addr); uint8_t mrf_read_long_addr(uint16_t addr); void mrf_write_short_addr(uint8_t addr, uint8_t val); diff --git a/fw/mrf/mrf_impl.h b/fw/mrf/mrf_impl.h index 0f97e9f..f2ae70f 100644 --- a/fw/mrf/mrf_impl.h +++ b/fw/mrf/mrf_impl.h @@ -26,7 +26,8 @@ #include #include -prog_uint8_t mrf_ext_addr[MRF_EXT_ADDR_LENGTH] = MRF_EXT_ADDR; +uint16_t mrf_short_addr = MRF_SHORT_ADDR; +uint16_t mrf_pan_id = MRF_PAN_ID; // set given short register to given value via spi void mrf_write_short_addr(uint8_t addr, uint8_t val) @@ -114,8 +115,10 @@ void mrf_init() mrf_set_reg(MRF_R_INTCON, ~(_BV(MRF_B_TXN) | _BV(MRF_B_RX))); // read and set address - for(uint8_t i = 0; i < MRF_EXT_ADDR_LENGTH; ++i) - mrf_set_reg(MRF_R_EADR0 + i, pgm_read_byte(mrf_ext_addr + i)); + mrf_set_reg(MRF_R_PANIDL, mrf_pan_id); + mrf_set_reg(MRF_R_PANIDH, mrf_pan_id>>8); + mrf_set_reg(MRF_R_SADRL, mrf_short_addr); + mrf_set_reg(MRF_R_SADRH, mrf_short_addr>>8); mrf_set_channel(0); } -- 2.11.4.GIT