36 #define DEBUG DEBUG_FULL
41 #include "dev/button-sensor.h"
48 #include "contiki-uart.h"
51 #include "platform_prints.h"
53 #ifndef OWN_SENSORS_DEFINITION
54 SENSORS(&button_sensor, &button_sensor2);
57 #ifndef M12_CONF_SERIAL
58 #define M12_SERIAL 0x000000
60 #define M12_SERIAL M12_CONF_SERIAL
70 if (!FORCE_ECONOTAG_I && CRM->SYS_CNTLbits.XTAL32_EXISTS) {
72 PRINTF(
"trim xtal for M12\n\r");
73 CRM->XTAL_CNTLbits.XTAL_CTUNE = (M12_CTUNE_4PF << 4) | M12_CTUNE;
74 CRM->XTAL_CNTLbits.XTAL_FTUNE = M12_FTUNE;
77 GPIO->FUNC_SEL.GPIO_63 = 3;
78 GPIO->PAD_PU_SEL.GPIO_63 = 0;
79 GPIO->FUNC_SEL.SS = 3;
80 GPIO->PAD_PU_SEL.SS = 1;
81 GPIO->FUNC_SEL.VREF2H = 3;
82 GPIO->PAD_PU_SEL.VREF2H = 1;
83 GPIO->FUNC_SEL.U1RTS = 3;
84 GPIO->PAD_PU_SEL.U1RTS = 1;
88 PRINTF(
"trim xtal for Econotag I\n\r");
89 CRM->XTAL_CNTLbits.XTAL_CTUNE = (ECONOTAG_CTUNE_4PF << 4) | ECONOTAG_CTUNE;
90 CRM->XTAL_CNTLbits.XTAL_FTUNE = ECONOTAG_FTUNE;
94 if (mc1322x_config.eui == 0) {
114 #if (M12_SERIAL == 0)
116 mc1322x_config.eui = (0x0050C2A8Cull << 24) | (*MACA_RANDOM & (0xffffff));
119 mc1322x_config.eui = (0xEC473C4D12ull << 24) | M12_SERIAL;
121 mc1322x_config_save(&mc1322x_config);
125 contiki_maca_set_mac_address(mc1322x_config.eui);
132 NETSTACK_NETWORK.init();
144 print_processes(autostart_processes);
145 autostart_start(autostart_processes);
151 if(uart1_input_handler !=
NULL) {
152 if(uart1_can_get()) {
153 uart1_input_handler(uart1_getc());
linkaddr_t linkaddr_node_addr
The Rime address of the node.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
#define NULL
The null pointer.
int main(void)
This is main...
void process_start(struct process *p, process_data_t data)
Start a process.
int process_run(void)
Run the system once - call poll handlers and process one event.
A set of debugging macros.
Include file for the Contiki low-layer network stack (NETSTACK)
Header file for the Rime address representation