/* ---------------------------------------------------------------------------- * initialization of Art-Net */ void artnet_init(void) { ARTNET_DEBUG("Init\n"); /* read Art-Net port */ artnet_port = CONF_ARTNET_PORT; /* read netconfig */ artnet_netConfig = NETCONFIG_DEFAULT; /* read subnet */ artnet_subNet = SUBNET_DEFAULT; artnet_inputUniverse = CONF_ARTNET_INUNIVERSE; artnet_outputUniverse = CONF_ARTNET_OUTUNIVERSE; #ifdef CONF_ARTNET_SEND_POLL_REPLY artnet_sendPollReplyOnChange = 1; #else artnet_sendPollReplyOnChange = 0; #endif strcpy_P(artnet_shortName, PSTR("e6ArtNode")); strcpy_P(artnet_longName, PSTR("e6ArtNode hostname: " CONF_HOSTNAME)); set_CONF_ARTNET_OUTPUT_IP(&artnet_outputTarget); /* dmx storage connection */ artnet_conn_id = dmx_storage_connect(artnet_inputUniverse); if (artnet_conn_id != -1) { artnet_connected = TRUE; ARTNET_DEBUG("Connection to dmx-storage established! id:%d\r\n", artnet_conn_id); } else { artnet_connected = FALSE; ARTNET_DEBUG("Connection to dmx-storage couldn't be established!\r\n"); } /* net_init */ artnet_netInit(); /* annouce that we are here */ ARTNET_DEBUG("send PollReply\n"); artnet_sendPollReply(&all_ones_addr); /* enable PollReply on changes */ artnet_sendPollReplyOnChange = TRUE; ARTNET_DEBUG("init complete\n"); return; }
// ---------------------------------------------------------------------------- // initialization of Art-Net void artnet_init(void) { // set ports for USART, port direction and dip-switches DMXDirectionPort |= (1<<DMXTXD)|(1<<DMXDIR_IO); // DIR_IO and TXD Output //PULLUP DMX IN/OUT DMXIOPullupPort |= (1<<DMXIOPullupPin); // read Art-Net port artnet_port = PORT_DEFAULT; // read netconfig artnet_netConfig = NETCONFIG_DEFAULT; // read subnet artnet_subNet = SUBNET_DEFAULT; artnet_inputUniverse1 = INUNIVERSE_DEFAULT; // read nr. of output universe artnet_outputUniverse1 = OUTUNIVERSE_DEFAULT; // read short name strcpy_P(artnet_shortName, PSTR("AvrArtNode\0")); artnet_shortName[SHORT_NAME_LENGTH - 1] = 0; // read long name strcpy_P(artnet_longName, PSTR("AVR based Art-Net node\0")); artnet_longName[LONG_NAME_LENGTH - 1] = 0; artnet_netInit(); // annouce that we are here artnet_sendPollReply(); // enable PollReply on changes artnet_sendPollReplyOnChange = TRUE; return; }
/* ---------------------------------------------------------------------------- * initialization of Art-Net */ void artnet_init(void) { ARTNET_DEBUG("Init\n"); /* read Art-Net port */ // eeprom_read_block(&artnet_port, (unsigned char *)ARTNET_PORT_EEPROM_STORE, 2); // if (artnet_port == 0xFFFF) { artnet_port = PORT_DEFAULT; // } /* read netconfig */ // artnet_netConfig = eeprom_read_byte((unsigned char *)ARTNET_NETCONFIG_EEPROM_STORE); // if (artnet_netConfig == 0xFF) { artnet_netConfig = NETCONFIG_DEFAULT; // } /* read subnet */ // artnet_subNet = eeprom_read_byte((unsigned char *)ARTNET_SUBNET_EEPROM_STORE); // if (artnet_subNet == 0xFF) { artnet_subNet = SUBNET_DEFAULT; // } /* read nr. of input universe */ // artnet_inputUniverse1 = eeprom_read_byte((unsigned char *)ARTNET_INUNIVERSE_EEPROM_STORE); // if (artnet_inputUniverse1 == 0xFF) { artnet_inputUniverse1 = INUNIVERSE_DEFAULT; // } /* read nr. of output universe */ // artnet_outputUniverse1 = eeprom_read_byte((unsigned char *)ARTNET_OUTUNIVERSE_EEPROM_STORE); // if (artnet_outputUniverse1 == 0xFF) { artnet_outputUniverse1 = OUTUNIVERSE_DEFAULT; // } /* read short name */ // eeprom_read_block(&artnet_shortName, (unsigned char *)ARTNET_SHORTNAME_EEPROM_STORE, SHORT_NAME_LENGTH); // if ((*((unsigned long*)&artnet_shortName[0])) == 0xFFFFFFFF) { /* fill with zeroes */ for (unsigned char i = 0; i < SHORT_NAME_LENGTH; i++) { artnet_shortName[i] = 0; } strcpy_P(artnet_shortName, PSTR("AvrArtNode")); // } artnet_shortName[SHORT_NAME_LENGTH - 1] = 0; /* read long name */ // eeprom_read_block(&artnet_longName, (unsigned char *)ARTNET_LONGNAME_EEPROM_STORE, LONG_NAME_LENGTH); // if ((*((unsigned long*)&artnet_longName[0])) == 0xFFFFFFFF) { /* fill with zeroes */ for (unsigned char i = 0; i < LONG_NAME_LENGTH; i++) { artnet_longName[i] = 0; } strcpy_P(artnet_longName, PSTR("AVR based Art-Net node")); // } artnet_longName[LONG_NAME_LENGTH - 1] = 0; // ARTNET_DEBUG("net init\n"); artnet_netInit(); /* annouce that we are here */ ARTNET_DEBUG("send PollReply\n"); artnet_sendPollReply(); /* enable PollReply on changes */ artnet_sendPollReplyOnChange = TRUE; ARTNET_DEBUG("init complete\n"); return; }