[OSADL-svn-commits] r105 - trunks/fddi-trunk/src
OSADL repository commits
osadl-svn-commits at lists.osadl.org
Tue Oct 2 11:47:59 CEST 2007
Author: robert
Date: Fri Aug 10 00:28:31 2007
New Revision: 105
Log:
more can updates
Modified:
trunks/fddi-trunk/src/libfddi_can.c
Modified: trunks/fddi-trunk/src/libfddi_can.c
==============================================================================
--- trunks/fddi-trunk/src/libfddi_can.c (original)
+++ trunks/fddi-trunk/src/libfddi_can.c Fri Aug 10 00:28:31 2007
@@ -75,7 +75,7 @@
.bit = 0,
};
-static fddi_pv_t pv_u_dc_can = {
+static fddi_pv_t pv_u_can = {
.id = {
.prefix = "u_can",
.index = -1,
@@ -231,9 +231,8 @@
int fddi_backend_configure(fddi_iface_t *iface, const char *configfile, void *data)
{
-#if 0
int ret;
- modbus_dev_t *modbus_dev = (modbus_dev_t*)(iface->priv);
+ can_iface_t *can_iface = (can_iface_t*)(iface->priv);
printf("parsing configfile: %s\n", configfile);
printf("for interface: %s\n", iface->id.id_as_string); /* FIXME private */
@@ -241,40 +240,25 @@
/* FIXME: everything's hardcoded & static for now, we add an xml parser later */
iface->tpulist_head = &tpu1;
- tpu1.pv_list_head = &pv1;
+ tpu1.pv_list_head = &pv_v_can;
+ tpu1.next = &tpu2;
- pv1.next = &pv2;
- pv2.previous = &pv1;
- pv2.next = &pv3;
- pv3.previous = &pv2;
-
- /* modbus has no hardware bus cycle, emulate one for each tpu */
- /* FIXME: loop */
- {
- modbus_tpu1.event.sigev_notify = SIGEV_THREAD;
- modbus_tpu1.event.sigev_notify_function = modbus_timer_handler;
- modbus_tpu1.event.sigev_notify_attributes = NULL;
- modbus_tpu1.event.sigev_value.sival_ptr = &tpu1;
- tpu1.priv = &modbus_tpu1;
-
- if ((ret = timer_create(CLOCK_REALTIME, &modbus_tpu1.event, &modbus_tpu1.timer)) < 0 ) {
- perror("timer create");
- return -1;
- }
- }
+ pv_v_can.next = &pv_n_can;
+ pv_n_can.previous = &pv_v_can;
+ pv_n_can.next = &pv_u_can;
+ pv_u_can.previous = &pv_n_can;
+ pv_u_can.next = &pv_i_can;
+ pv_i_can.previous = &pv_u_can;
- if (modbus_bind(modbus_dev, "192.168.23.242", 502) == -1) {
- fprintf(stderr, "modbus_bind() failed\n");
- return -1;
- }
+ tpu2.pv_list_head = &pv_arate_can;
+ tpu2.previous = &tpu1;
- /* FIXME: modbus_dev must be put into the device, not iface! */
- modbus_tpu1.modbus_dev = modbus_dev;
+ pv_arate_can.next = &pv_srate_can;
+ pv_srate_can.previous = &pv_arate_can;
/* we are ready now and go into preoperational state */
-
fddi_backend_setstate(iface, STATE_PREOPERATIONAL);
-#endif
+
return 0;
}
More information about the OSADL-svn-commits
mailing list