Changeset 1032


Ignore:
Timestamp:
01/15/2010 06:07:10 PM (2 years ago)
Author:
jcy
Message:

Updates to tdma-asap for modular or regular cca.

Location:
nano-RK
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • nano-RK/projects/test_tdma/main.c

    r1031 r1032  
    3838//#include "main.h" 
    3939#define TDMA_CHANNEL 18 
    40 #define TDMA_CCA -35 
     40#define TDMA_CCA -45 
    4141 
    4242// Only require MAC address for address decode  
     
    4444#define EVENT_PERIOD_SECS 10 
    4545 
    46 #define TDMA_MODE TDMA_MASTER 
     46#define TDMA_MODE TDMA_SLAVE 
    4747#define SMALL_STACK 256 
    4848 
  • nano-RK/src/net/tdma_asap/tdma_asap.c

    r1031 r1032  
    5353 
    5454// general to collect tdma statistics 
    55 //#define TDMA_STATS_COLLECT 
     55#define TDMA_STATS_COLLECT 
    5656 
    5757#ifdef TDMA_STATS_COLLECT 
     
    6060 
    6161// Use a preamble instead of CCA to do the handshake 
    62 #define TDMA_PREAMBLE_HANDSHAKE 
    63  
    64 //#define TDMA_TEXT_DEBUG 
     62//#define TDMA_PREAMBLE_HANDSHAKE 
     63 
     64#define TDMA_TEXT_DEBUG 
     65//#define TDMA_TEXT_DEBUG_ALL 
    6566 
    6667// to use some of the pin debug symbols, #define them as  
     
    8081// raise pin during check period until end or jam is detected 
    8182// also raise pin while jamming 
    82 //#define JAM_CHECK_DEBUG DEBUG_1 
     83#define JAM_CHECK_DEBUG DEBUG_1 
    8384 
    8485// oscillate DEBUG_0 at beginning of every slot 
    85 //#define GPIO_NEWTMR_SLT_DEBUG DEBUG_0 
     86#define GPIO_NEWTMR_SLT_DEBUG DEBUG_0 
    8687 
    8788// raise pin for actual TX 
     
    229230    int8_t val; 
    230231    rf_polling_rx_on(); 
     232    // 8 symbol periods 
     233    nrk_spin_wait_us(128); 
    231234    nrk_spin_wait_us(250); 
    232235    val=CCA_IS_1; 
     
    241244} 
    242245 
    243 // Functions to set the RX in unbuffered mode for RX 
    244 // Such is done for slot stealing by the master node 
    245 /* 
    246 _rf_rx_set_unbuffered() 
    247 { 
    248     FASTSPI_STROBE(CC2420_SRFOFF);           // stop radio 
    249     FASTSPI_SETREG(CC2420_MDMCTRL1, 0x0501); // Set RX_MODE=1 
    250     rf_flush_rx_fifo(); 
    251 } 
    252 */ 
    253  
    254 //int8_t _rf_rx_set_buffered() 
    255 //{ 
    256 //    FASTSPI_STROBE(CC2420_SRFOFF);           // stop radio 
    257 //    FASTSPI_SETREG(CC2420_MDMCTRL1, 0x0500); // Set RX_MODE=0 
    258 //    rf_flush_rx_fifo(); 
    259  
    260 //    return NRK_OK; 
    261 //} 
    262246/** 
    263247 *  This is a callback if you require immediate response to a packet 
     
    525509    printf("tdma chan %d cca %d\r\n", tdma_channel, tdma_cca_thresh); 
    526510 
    527 #ifdef TDMA_TEXT_DEBUG 
     511#ifdef TDMA_TEXT_DEBUG_ALL 
    528512    printf("TDMA Running. I am %d.\r\n" , my_addr16); 
    529513#endif 
     
    600584    uint32_t mini_pkt_val; 
    601585    uint16_t hst_rx_timeout, hst_rx_wait; 
     586    uint8_t mpkt_sender; 
     587    uint16_t mpkt_rcvid; 
    602588 
    603589    //nrk_kprintf(PSTR("Calling tdma_rx()\r\n")); 
    604 #ifdef TDMA_TEXT_DEBUG 
    605     printf("RX slot %d\r\n", next_schedule_entry.slot); 
    606 #endif 
    607590    heard_sender = 0; 
    608591 
     
    777760                    rf_rx_off(); 
    778761                    rf_data_mode(); 
    779                     rf_rx_set_serial(); 
     762                    //rf_rx_set_serial(); 
    780763                     
    781764#ifdef TDMA_STATS_COLLECT 
    782765    stats_stop_rdo(); 
    783766#endif 
     767 
     768    PORTA |= BM(DEBUG_1); 
    784769                     
    785770#ifdef TDMA_STATS_COLLECT 
     771    // get the time of the mini packet arrival 
     772    nrk_time_get(&current_time); 
     773    nrk_time_compact_nanos(&current_time); 
    786774    // bottom 4 bits are the address 
    787775    // add 1 to adjust (cause nodes go 1-16 instead of 0-15 
    788     uint8_t mpkt_sender = (mini_pkt_val & 0x0F)+1; 
     776    mpkt_sender = (mini_pkt_val & 0x0F)+1; 
    789777     
    790778    // top 12 bits are the event_id 
    791     uint16_t mpkt_rcvid = (mini_pkt_val >> 4); 
    792  
    793     nrk_time_get(&current_time); 
    794     nrk_time_compact_nanos(&current_time); 
    795     sprintf(mpkt_log[mpkt_log_curbuf++], "DELR %u %u %u %20"PRIu32" %20"PRIu32"", mpkt_sender, mpkt_rcvid, my_addr16, 
    796             current_time.secs, current_time.nano_secs); 
    797 #endif 
     779    mpkt_rcvid = (mini_pkt_val >> 4); 
     780#endif 
     781 
     782    PORTA &= ~BM(DEBUG_1); 
    798783 
    799784                    // register minipacket as rcv 
     
    819804    stats_start_rdo(); 
    820805#endif 
    821                     rf_rx_on(); 
     806                    //rf_rx_on(); 
    822807 
    823808                    //make the new timeout the end of the current delta slot 
     
    827812 
    828813                } 
     814                /* 
    829815                else 
    830816                { 
     817                    // this can't happen anymore  
    831818                    // this runs if 2 minipackets somehow arrive in the same delta slot 
    832                     rf_rx_off(); 
    833                     rf_data_mode(); 
    834                     rf_rx_set_serial(); 
    835  
    836                     rf_rx_on(); 
    837                     heard_sender = 2; 
    838                     nrk_kprintf(PSTR("Heard >1 sender\r\n")); 
     819                     
     820                    //rf_rx_off(); 
     821                    //rf_data_mode(); 
     822                    //rf_rx_set_serial(); 
     823 
     824                    //rf_rx_on(); 
     825                    //heard_sender = 2; 
     826                    //nrk_kprintf(PSTR("Heard >1 sender\r\n")); 
     827 
    839828#ifdef TDMA_STATS_COLLECT 
    840829    steal_dbl_pkt(); 
     
    842831                    continue; 
    843832                } 
     833                */ 
    844834    #else 
    845835                rf_test_mode(); 
     
    848838                heard_sender = 1; 
    849839                nrk_spin_wait_us(10); 
    850     #ifdef TDMA_TEXT_DEBUG 
    851                 nrk_kprintf(PSTR("Got mini pkt\r\n")); 
    852     #endif 
    853840 
    854841    #ifdef GPIO_DELTA_DEBUG 
     
    891878            // No one sent a signal; I'm not expecting a packet, 
    892879            // so I can finish and sleep. 
    893             #ifdef TDMA_TEXT_DEBUG 
     880            #ifdef TDMA_TEXT_DEBUG_ALL 
    894881                nrk_kprintf(PSTR("No sender heard\r\n")); 
    895882            #endif 
     
    908895#ifdef TDMA_PREAMBLE_HANDSHAKE 
    909896 
    910         uint8_t cnt=0; 
    911897        if (next_schedule_entry.priority!=1) 
    912898        { 
     
    917903            // keep sending preambles repeatedly 
    918904 
    919             // MOD_CCA 13 jan 2010 : Just throw on the radio and let it roll 
     905            // MOD_CCA 13 jan 2010 : Just throw on the radio in serial mode and let it roll 
     906    #ifdef TDMA_STATS_COLLECT 
     907                stats_start_rdo(); 
     908    #endif 
    920909            rf_carrier_on(); 
     910 
     911        #ifdef JAM_CHECK_DEBUG 
     912            PORTA |= BM(JAM_CHECK_DEBUG); 
     913        #endif 
    921914 
    922915            // this timing needs perfected 
     
    924917            while (_nrk_high_speed_timer_get() < (DATA_SLOT_START_TICKS+DELTA_SLOT_OFFSET)) 
    925918            { 
    926  
    927     #ifdef TDMA_STATS_COLLECT 
    928                 stats_start_rdo(); 
    929     #endif 
    930919 
    931920                /* 
     
    937926                nrk_high_speed_timer_wait(0,TDMA_DELTA_SLOT_TICKS * ((_nrk_high_speed_timer_get() / TDMA_DELTA_SLOT_TICKS)+1)); 
    938927                rf_carrier_off(); 
    939                 cnt++; 
    940928                */ 
     929 
     930            }  
    941931 
    942932    #ifdef TDMA_STATS_COLLECT 
     
    944934    #endif 
    945935 
    946             }  
    947  
    948936            // MOD_CCA 13 Jan 2010 
    949937            rf_carrier_off(); 
     938 
     939        #ifdef JAM_CHECK_DEBUG 
     940            PORTA &= ~BM(JAM_CHECK_DEBUG); 
     941        #endif 
    950942 
    951943            //rf_set_preamble_length(2); // 3 bytes, 802.15.4 compliant 
     
    10371029    rf_polling_rx_on (); 
    10381030 
    1039     printf("cnt %d\r\n",cnt); 
    10401031     n = 0; 
    10411032 
     
    10701061                //nrk_gpio_clr(NRK_DEBUG_1); 
    10711062                //printf("Leaving tx  %20"PRIu32" :  %20"PRIu32"\r\n",current_time.secs,current_time.nano_secs); 
     1063                nrk_kprintf(PSTR("no pkt\r\n")); 
     1064 
     1065#ifdef TDMA_STATS_COLLECT 
     1066                sprintf(mpkt_log[mpkt_log_curbuf++], "DELR %u %u %u %20"PRIu32" %20"PRIu32"", mpkt_sender, mpkt_rcvid, my_addr16, 
     1067                        current_time.secs, current_time.nano_secs); 
     1068#endif 
    10721069                return; 
    10731070            } 
     
    12491246    nrk_led_clr (GREEN_LED); 
    12501247#endif 
     1248 
     1249#ifdef TDMA_STATS_COLLECT 
     1250                sprintf(mpkt_log[mpkt_log_curbuf++], "DELR %u %u %u %20"PRIu32" %20"PRIu32"", mpkt_sender, mpkt_rcvid, my_addr16, 
     1251                        current_time.secs, current_time.nano_secs); 
     1252#endif 
     1253 
    12511254    //printf("mp %02lX\r\n",mini_pkt_val); 
    12521255    //printf("minipkt from 0x%02lX %u, %u\r\n", mini_pkt_val, mp_correct, mp_rcv); 
     
    13391342#ifdef TDMA_PREAMBLE_HANDSHAKE 
    13401343    #ifdef TDMA_STATS_COLLECT 
    1341         //stats_start_rdo(); 
     1344        stats_start_rdo(); 
    13421345    #endif 
    13431346        //rf_rx_on(); 
    13441347        // MOD_CCA 13 Jan 2010:  
    1345         rf_set_cca_mode(1); 
     1348        rf_set_cca_mode(2); 
     1349        rf_polling_rx_on(); 
     1350        nrk_spin_wait_us(128); // 8 symbol periods 
     1351#else 
     1352    #ifdef TDMA_STATS_COLLECT 
     1353        stats_start_rdo(); 
     1354    #endif 
     1355        rf_polling_rx_on(); 
     1356        nrk_spin_wait_us(128); // 8 symbol periods 
    13461357#endif 
    13471358 
     
    13541365            //if (SFD_IS_1) 
    13551366            // MOD_CCA 13 Jan 2010: use CCA (modified method) 
    1356             if (!_tdma_channel_check()) 
     1367            if (!CCA_IS_1) 
    13571368#else 
    1358             if (!_tdma_channel_check()) // if channel activity 
     1369            //if (!_tdma_channel_check()) // if channel activity 
     1370            if (!CCA_IS_1) 
    13591371#endif 
    13601372            { 
    13611373                // Detected channel activity 
    1362 //#ifdef TDMA_TEXT_DEBUG 
     1374#ifdef TDMA_TEXT_DEBUG 
    13631375                nrk_kprintf(PSTR("NO STEAL\r\n")); 
    1364 //#endif 
     1376#endif 
    13651377 
    13661378#ifdef TDMA_STATS_COLLECT 
     
    13701382#if defined(TDMA_PREAMBLE_HANDSHAKE) && defined(TDMA_STATS_COLLECT) 
    13711383                stats_stop_rdo(); 
     1384#elif defined(TDMA_STATS_COLLECT) // no preamble, but still collecting stats 
     1385                stats_stop_rdo(); 
    13721386#endif 
    13731387                nrk_led_set(GREEN_LED); 
     1388                rf_set_cca_mode(1); 
    13741389                return; 
    13751390            } 
    13761391        } 
    1377         while (_nrk_high_speed_timer_get() < (TDMA_DELTA_SLOT_TICKS * (next_schedule_entry.priority))); 
     1392        while (_nrk_high_speed_timer_get() < (TDMA_DELTA_SLOT_TICKS * (next_schedule_entry.priority * 2))); 
    13781393#ifdef STEALCHECK_DEBUG 
    13791394        PORTA &= ~BM(STEALCHECK_DEBUG); 
     
    13881403#ifdef TDMA_PREAMBLE_HANDSHAKE 
    13891404    // MOD_CCA 13 Jan 2010 
    1390     rf_set_cca_mode(2); 
     1405    rf_set_cca_mode(1); 
    13911406#endif 
    13921407 
     
    15191534    //printf("mpkt %20"PRIu32"\r\n", send_value); 
    15201535 
    1521     #ifdef TDMA_TEXT_DEBUG 
    1522         nrk_kprintf(PSTR("Sent mpkt\r\n")); 
    1523     #endif 
    1524  
    15251536    #ifdef TDMA_STATS_COLLECT 
    15261537        // submit the minipacket log using sprintf 
     
    15291540            nrk_time_get(&current_time); 
    15301541            nrk_time_compact_nanos(&current_time); 
    1531             sprintf(mpkt_log[mpkt_log_curbuf++], "DELT %u %u %u %20"PRIu32" %20"PRIu32"", my_addr16, minipkt_id-1, my_parent, 
    1532                 current_time.secs, current_time.nano_secs); 
    15331542        } 
    15341543    #endif 
     
    15721581    { 
    15731582        // first make sure it's the end of my delta slot  
    1574        nrk_high_speed_timer_wait(0, (DELTA_SLOT_OFFSET + (TDMA_DELTA_SLOT_TICKS * (next_schedule_entry.priority + 1)))); 
     1583       nrk_high_speed_timer_wait(0, (DELTA_SLOT_OFFSET + (TDMA_DELTA_SLOT_TICKS * ((next_schedule_entry.priority*2) + 1)))); 
    15751584#ifdef JAM_CHECK_DEBUG 
    15761585    PORTA |= BM(JAM_CHECK_DEBUG); 
     
    15841593        //rf_rx_set_serial(); 
    15851594        //rf_rx_on(); 
    1586         rf_set_cca_mode(2); 
     1595        rf_set_cca_mode(2); // set CCA mode to check if receiving valid 802.15 data. 
     1596        rf_polling_rx_on(); 
     1597        nrk_spin_wait_us(128); // 8 symbol periods 
    15871598        while (_nrk_high_speed_timer_get() < (DATA_SLOT_START_TICKS + DELTA_SLOT_OFFSET) && 
    1588             (v = _tdma_channel_check())); 
     1599            (v = CCA_IS_1)); 
    15891600            //(v = !(SFD_IS_1))); 
    15901601#else 
     1602    #ifdef TDMA_STATS_COLLECT 
     1603        stats_start_rdo(); 
     1604    #endif 
     1605        rf_polling_rx_on(); 
     1606        nrk_spin_wait_us(128); 
    15911607        // wait while we are still before the data slot start time and the channel is free 
    15921608        while (_nrk_high_speed_timer_get() < (DATA_SLOT_START_TICKS + DELTA_SLOT_OFFSET) && 
    1593             (v = _tdma_channel_check())); 
     1609            //(v = _tdma_channel_check())); 
     1610            (v = CCA_IS_1)); 
     1611    #ifdef TDMA_STATS_COLLECT 
     1612        stats_stop_rdo(); 
     1613    #endif 
    15941614#endif 
    15951615 
     
    15991619        { 
    16001620            //nrk_kprintf(PSTR("ClrChan\r\n")); 
    1601     //#ifdef TDMA_TEXT_DEBUG 
    1602             nrk_kprintf(PSTR("Parent didn't hear mpkt\r\n")); 
    1603     //#endif 
     1621    #ifdef TDMA_TEXT_DEBUG 
     1622           nrk_kprintf(PSTR("No ack\r\n")); 
     1623    #endif 
    16041624            nrk_led_set(GREEN_LED); 
    16051625    #ifdef TDMA_PREAMBLE_HANDSHAKE 
     
    16151635        PORTA &= ~BM(JAM_CHECK_DEBUG); 
    16161636    #endif 
     1637    #ifdef TDMA_STATS_COLLECT 
     1638            // submit the minipacket log using sprintf 
     1639            if (next_schedule_entry.type == TDMA_TX_PARENT) 
     1640            { 
     1641                sprintf(mpkt_log[mpkt_log_curbuf++], "DELT %u %u %u %20"PRIu32" %20"PRIu32"", my_addr16, minipkt_id-1, my_parent, 
     1642                current_time.secs, current_time.nano_secs); 
     1643            } 
     1644    #endif 
    16171645            return; 
    16181646        } 
     
    16221650        stats_stop_rdo(); 
    16231651    #endif 
     1652        rf_set_cca_mode(1); 
    16241653        rf_rx_off(); 
    16251654        rf_data_mode(); 
     
    17311760    nrk_led_clr (RED_LED); 
    17321761#endif 
     1762 
     1763    #ifdef TDMA_STATS_COLLECT 
     1764            // submit the minipacket log using sprintf 
     1765            if (next_schedule_entry.type == TDMA_TX_PARENT) 
     1766            { 
     1767                sprintf(mpkt_log[mpkt_log_curbuf++], "DELT %u %u %u %20"PRIu32" %20"PRIu32"", my_addr16, minipkt_id-1, my_parent, 
     1768                current_time.secs, current_time.nano_secs); 
     1769            } 
     1770    #endif 
    17331771 
    17341772}  // END TDMA_TX 
     
    18651903{ 
    18661904    nrk_wait(period_delay_time); 
    1867 #ifdef TDMA_TEXT_DEBUG 
    1868     nrk_kprintf(PSTR("Waiting for tdma_init()\r\n")); 
     1905#ifdef TDMA_TEXT_DEBUG_ALL 
     1906    nrk_kprintf(PSTR("Wait on tdma_init\r\n")); 
    18691907#endif 
    18701908} 
     
    18771915    // otherwise fail out. 
    18781916#ifdef TDMA_TREEMAKE 
    1879     #ifdef TDMA_TEXT_DEBUG 
    1880         nrk_kprintf(PSTR("call tree_create\r\n")); 
    1881     #endif 
    1882  
    18831917    tdma_tree_create(tdma_channel); 
    18841918    #ifdef TDMA_STATS_COLLECT 
    18851919        nrk_time_get(&tree_creation_time); 
    18861920    #endif 
    1887  
    18881921#else 
    18891922    nrk_kprintf(PSTR("TDMA_SCHED_TREE specified, but TDMA_TREEMAKE not defined.\r\n")); 
     
    19091942} 
    19101943 
    1911 #ifdef TDMA_TEXT_DEBUG 
     1944#ifdef TDMA_TEXT_DEBUG_ALL 
    19121945    printf("TDMA Started\r\n"); 
    19131946#endif 
     
    19932026                if (n != 1) 
    19942027                { 
    1995 #ifdef TDMA_TEXT_DEBUG 
     2028#ifdef TDMA_TEXT_DEBUG_ALL 
    19962029                    printf("FAILED recv: n = %d\r\n", n); 
    19972030#endif 
     
    23582391                _tdma_tx(next_schedule_entry.slot); // send sync 
    23592392                tdma_rfTxInfo.length = tmp_length; 
    2360 #ifdef TDMA_TEXT_DEBUG 
    2361                 nrk_kprintf(PSTR("Sent sync packet\r\n")); 
     2393#ifdef TDMA_TEXT_DEBUG_ALL 
     2394                nrk_kprintf(PSTR("Sent sync\r\n")); 
    23622395#endif 
    23632396            } 
     
    23722405                    { 
    23732406                        if (next_schedule_entry.priority == 0) 
    2374                             nrk_kprintf(PSTR("Normal send\r\n")); 
     2407                        #ifdef TDMA_TEXT_DEBUG_ALL 
     2408                            nrk_kprintf(PSTR("Normal send\r\n")) 
     2409                        #endif 
     2410                            ; 
    23752411                        else  
    23762412                            nrk_kprintf(PSTR("DIDSTEAL\r\n")); 
     
    23792415#endif 
    23802416                } 
    2381 #ifdef TDMA_TEXT_DEBUG 
     2417#ifdef TDMA_TEXT_DEBUG_ALL 
    23822418                else 
    23832419                    nrk_kprintf(PSTR("Nothing to send\r\n")); 
    23842420#endif 
    23852421            } 
    2386 #ifdef TDMA_TEXT_DEBUG 
     2422#ifdef TDMA_TEXT_DEBUG_ALL 
    23872423            else 
    2388                 nrk_kprintf(PSTR("Slave and invalid slot type\r\n")); 
     2424                nrk_kprintf(PSTR("Slv: invalid slot type\r\n")); 
    23892425#endif 
    23902426        } 
    2391 #ifdef TDMA_TEXT_DEBUG 
     2427#ifdef TDMA_TEXT_DEBUG_ALL 
    23922428        else 
    2393             nrk_kprintf(PSTR("Master and invalid slot type\r\n")); 
     2429            nrk_kprintf(PSTR("Mstr: invalid slot type\r\n")); 
    23942430#endif 
    23952431 
  • nano-RK/src/net/tdma_asap/tdma_asap.h

    r1026 r1032  
    9090    //CHANGED  
    9191    // 3000  
    92     #define TDMA_SLOT_DATA_TIME_US  8724 
     92 
     93    // commented out 13 Jan 2010 
     94    //#define TDMA_SLOT_DATA_TIME_US  8724 
     95 
    9396    #define TDMA_TICKS_PER_SLOT 12 
    9497 
     
    120123//#define DATA_SLOT_START_TICKS 58982 
    121124//CHANGED 
    122 #define DATA_SLOT_START_TICKS 22118 
     125 
     126// commented out 13 Jan 2010: Good for 9 children, 10 delta slots 
     127//#define DATA_SLOT_START_TICKS 22118 
     128//#define SFD_TO_SLOT_TIME 48703 
     129//#define TDMA_SLOT_DATA_TIME_US  8724 
     130//#define TREE_MAX_CHILDREN 9 
     131 
     132 
     133// New times: for 10 children, 11 delta slots 
     134#define DATA_SLOT_START_TICKS 24431 
     135#define SFD_TO_SLOT_TIME 47729 
     136#define TDMA_SLOT_DATA_TIME_US  8424 
     137#define TREE_MAX_CHILDREN 10 
    123138 
    124139// 192 uS 
     
    130145 
    131146 
    132  
    133 //#define TDMA_DELTA_SLOT_TICKS 5898 
    134 //CHANGED 
    135147#define TDMA_DELTA_SLOT_TICKS 2212 
    136148 
     
    152164// RTL is 27750, so 27750 + 4733 = 32483 
    153165//#define SFD_TO_SLOT_TIME 32483 
    154 #define SFD_TO_SLOT_TIME 48703 
     166//#define SFD_TO_SLOT_TIME 48703 
    155167 
    156168 
     
    166178 
    167179// max number of children/neighbors to keep track of 
    168 #define TREE_MAX_CHILDREN 9 
     180//#define TREE_MAX_CHILDREN 9 
    169181#define NUM_DELTA_SLOTS (TREE_MAX_CHILDREN+1) 
    170182#define TREE_MAX_NEIGHBORS 15  
  • nano-RK/src/net/tdma_asap/tdma_asap_tree.c

    r1031 r1032  
    18151815 */ 
    18161816 
    1817 //#if 0 
     1817#if 0 
    18181818void color_graph() 
    18191819{ 
     
    21962196        } 
    21972197} 
    2198 //#endif 
    2199 #ifdef COLOR_OPT 
     2198#endif 
     2199#if 0 
    22002200void color_graph2() 
    22012201{ 
  • nano-RK/src/net/tdma_asap/tdma_asap_tree.h

    r1028 r1032  
    2727 
    2828// whether to add stealable slots or not to schedule 
    29 #define SLOT_STEALING_SCHED 
     29//#define SLOT_STEALING_SCHED 
    3030 
    3131// define whether to use discrete scheduling or regular coloring 
     
    5959  uint8_t isDead; 
    6060  tdma_color_t color; 
    61 #ifdef COLOR_OPT 
     61#if 0 
    6262  tdma_color_t color2; 
    6363  tdma_color_t color4; 
     
    7474#ifdef TDMA_MASTER_MODE 
    7575 
    76 uint16_t uncolored_node_list[2][DIM];  //List of nodes that have not been colored yet. 
    77 uint16_t colored_node_list[DIM];  //List of nodes that have  been colored 
     76//uint16_t uncolored_node_list[2][DIM];  //List of nodes that have not been colored yet. 
     77//uint16_t colored_node_list[DIM];  //List of nodes that have  been colored 
    7878uint8_t Neighbors[DIM][DIM]; //To keep track of neighbors for graph coloring 
    79 uint8_t colors_used[DIM];       //To record the num of colors used per level 
    80 uint8_t colors_used_level[DIM][DIM]; 
     79//uint8_t colors_used[DIM];     //To record the num of colors used per level 
     80//uint8_t colors_used_level[DIM][DIM]; 
    8181 
    82     #ifdef COLOR_OPT 
     82    #if 0 
    8383// for OPT2 
    8484uint16_t uncolored_node_list2[2][DIM];  //List of nodes that have not been colored yet. 
     
    9797sensorInfo sensorsInfo[DIM]; 
    9898 
    99 uint8_t graphColors[20][5]; 
     99//uint8_t graphColors[20][5]; 
    100100//char graphColors[20][30]; 
    101101 
Note: See TracChangeset for help on using the changeset viewer.