# HG changeset patch
# User etisserant
# Date 1175932145 -7200
# Node ID d2fc5d5f8a3624040004bdbb745e63c41c72ed92
# Parent fe50ada8020bb7f74099097c0d15965bd1ffb3a4
Some win32 fixes following yesterday's API changes.
diff -r fe50ada8020b -r d2fc5d5f8a36 CanFestival-3.vc8.vcproj
--- a/CanFestival-3.vc8.vcproj Fri Apr 06 16:49:28 2007 +0200
+++ b/CanFestival-3.vc8.vcproj Sat Apr 07 09:49:05 2007 +0200
@@ -1,532 +1,520 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r fe50ada8020b -r d2fc5d5f8a36 drivers/win32/drivers_win32.cpp
--- a/drivers/win32/drivers_win32.cpp Fri Apr 06 16:49:28 2007 +0200
+++ b/drivers/win32/drivers_win32.cpp Sat Apr 07 09:49:05 2007 +0200
@@ -34,8 +34,6 @@
#include "canfestival.h"
#include "timer.h"
-#include "nvram_driver.h"
-#include "lss_driver.h"
#include "timers_driver.h"
};
@@ -44,15 +42,6 @@
typedef void* (*CANOPEN_DRIVER_PROC)(s_BOARD *board);
typedef int (*CANCLOSE_DRIVER_PROC)(void* inst);
-typedef int (*NVRAM_OPEN_PROC)(void);
-typedef void (*NVRAM_CLOSE_PROC)(void);
-typedef char (*NVRAM_WRITE_PROC)(int type, int access_attr, void *data);
-typedef char (*NVRAM_READ_PROC)(int type, int access_attr, void *data);
-
-typedef void (*LED_SET_REDGREEN_PROC)(CO_Data *d, unsigned char bits);
-
-typedef UNS8 (*BAUDRATE_VALID_PROC)(UNS32 table_index);
-typedef void (*BAUDRATE_SET_PROC)(UNS8 table_index);
class driver_procs
{
@@ -70,17 +59,6 @@
CANOPEN_DRIVER_PROC m_canOpen;
CANCLOSE_DRIVER_PROC m_canClose;
- // nvram driver
- NVRAM_OPEN_PROC m_nvram_open;
- NVRAM_CLOSE_PROC m_nvram_close;
- NVRAM_WRITE_PROC m_nvram_write;
- NVRAM_READ_PROC m_nvram_read;
- // led driver
- LED_SET_REDGREEN_PROC m_led_set_redgreen;
- // lss driver
- BAUDRATE_VALID_PROC m_baudrate_valid;
- BAUDRATE_SET_PROC m_baudrate_set;
-
// driver module habndle
HMODULE m_driver_handle;
};
@@ -89,13 +67,6 @@
m_canSend(0),
m_canOpen(0),
m_canClose(0),
- m_nvram_open(0),
- m_nvram_close(0),
- m_nvram_write(0),
- m_nvram_read(0),
- m_led_set_redgreen(),
- m_baudrate_valid(0),
- m_baudrate_set(0),
m_driver_handle(0)
{}
@@ -132,17 +103,6 @@
m_canSend = (CANSEND_DRIVER_PROC)::GetProcAddress(m_driver_handle, myTEXT("canSend_driver"));
m_canOpen = (CANOPEN_DRIVER_PROC)::GetProcAddress(m_driver_handle, myTEXT("canOpen_driver"));
m_canClose = (CANCLOSE_DRIVER_PROC)::GetProcAddress(m_driver_handle, myTEXT("canClose_driver"));
-
- m_nvram_open = (NVRAM_OPEN_PROC)::GetProcAddress(m_driver_handle, myTEXT("nvram_open_driver"));
- m_nvram_close = (NVRAM_CLOSE_PROC)::GetProcAddress(m_driver_handle, myTEXT("nvram_close_driver"));
- m_nvram_write = (NVRAM_WRITE_PROC)::GetProcAddress(m_driver_handle, myTEXT("nvram_write_driver"));
- m_nvram_read = (NVRAM_READ_PROC)::GetProcAddress(m_driver_handle, myTEXT("nvram_read_driver"));
-
- m_led_set_redgreen = (LED_SET_REDGREEN_PROC)::GetProcAddress(m_driver_handle, myTEXT("led_set_redgreen_driver"));
-
- m_baudrate_valid = (BAUDRATE_VALID_PROC)::GetProcAddress(m_driver_handle, myTEXT("baudrate_valid_driver"));
- m_baudrate_set = (BAUDRATE_SET_PROC)::GetProcAddress(m_driver_handle, myTEXT("baudrate_set_driver"));
-
return can_driver_valid()?m_driver_handle:NULL;
}
@@ -233,68 +193,21 @@
/***************************************************************************/
int canClose(CO_Data * d)
{
- if (fd0 != NULL && s_driver_procs.m_canClose != NULL)
- {
- EnterMutex();
- driver_data* data = (driver_data*)d->canHandle;
- d->canHandle = NULL;
- LeaveMutex();
- data->continue_receive_thread = false;
- WaitReceiveTaskEnd(&data->receive_thread);
- (*s_driver_procs.m_canClose)(data->inst);
- delete data;
- return 0;
+ if (s_driver_procs.m_canClose != NULL)
+ {
+ driver_data* data;
+ EnterMutex();
+ if(d->canHandle != NULL){
+ data = (driver_data*)d->canHandle;
+ d->canHandle = NULL;
+ data->continue_receive_thread = false;}
+ LeaveMutex();
+ WaitReceiveTaskEnd(&data->receive_thread);
+ (*s_driver_procs.m_canClose)(data->inst);
+ delete data;
+ return 0;
}
return 0;
}
-/***************************************************************************/
-int nvram_open(void)
- {
- if (s_driver_procs.m_nvram_read != NULL)
- return (*s_driver_procs.m_nvram_open)();
- return -1;
- }
-
-void nvram_close(void)
- {
- if (s_driver_procs.m_nvram_close != NULL)
- (*s_driver_procs.m_nvram_close)();
- }
-
-char nvram_write(int type, int access_attr, void *data)
- {
- if (s_driver_procs.m_nvram_write != NULL)
- return (*s_driver_procs.m_nvram_write)(type, access_attr, data);
- return 0;
- }
-
-char nvram_read(int type, int access_attr, void *data)
- {
- if (s_driver_procs.m_nvram_read != NULL)
- return (*s_driver_procs.m_nvram_read)(type, access_attr, data);
- return 0;
- }
-
-/***************************************************************************/
-
-void led_set_redgreen(CO_Data *d, unsigned char bits)
- {
- if (s_driver_procs.m_led_set_redgreen != NULL)
- (*s_driver_procs.m_led_set_redgreen)(d, bits);
- }
-
-/***************************************************************************/
-
-UNS8 baudrate_valid(UNS32 table_index)
- {
- if (s_driver_procs.m_baudrate_valid != NULL)
- return (*s_driver_procs.m_baudrate_valid)(table_index);
- return 0;
- }
-
-void baudrate_set(UNS8 table_index)
- {
- if (s_driver_procs.m_baudrate_set != NULL)
- (*s_driver_procs.m_baudrate_set)(table_index);
- }
+
diff -r fe50ada8020b -r d2fc5d5f8a36 include/states.h
--- a/include/states.h Fri Apr 06 16:49:28 2007 +0200
+++ b/include/states.h Sat Apr 07 09:49:05 2007 +0200
@@ -63,10 +63,10 @@
typedef void (*operational_t)(void);
typedef void (*stopped_t)(void);
-void _initialisation();
-void _preOperational();
-void _operational();
-void _stopped();
+void _initialisation(void);
+void _preOperational(void);
+void _operational(void);
+void _stopped(void);
#include "data.h"
diff -r fe50ada8020b -r d2fc5d5f8a36 include/sync.h
--- a/include/sync.h Fri Apr 06 16:49:28 2007 +0200
+++ b/include/sync.h Sat Apr 07 09:49:05 2007 +0200
@@ -28,10 +28,10 @@
void stopSYNC(CO_Data* d);
typedef void (*post_sync_t)(void);
-void _post_sync();
+void _post_sync(void);
typedef void (*post_TPDO_t)(void);
-void _post_TPDO();
+void _post_TPDO(void);
/** transmit a SYNC message on the bus number bus_id
* bus_id is hardware dependant
diff -r fe50ada8020b -r d2fc5d5f8a36 src/nmtSlave.c
--- a/src/nmtSlave.c Fri Apr 06 16:49:28 2007 +0200
+++ b/src/nmtSlave.c Sat Apr 07 09:49:05 2007 +0200
@@ -22,6 +22,7 @@
#include "nmtSlave.h"
#include "states.h"
+#include "canfestival.h"
/*******************************************************************)*********/
/* put the slave in the state wanted by the master */
diff -r fe50ada8020b -r d2fc5d5f8a36 src/win32/CanFestival-3.def
--- a/src/win32/CanFestival-3.def Fri Apr 06 16:49:28 2007 +0200
+++ b/src/win32/CanFestival-3.def Sat Apr 07 09:49:05 2007 +0200
@@ -65,21 +65,11 @@
canReceive
canOpen
canClose
- lss_SwitchModeGlobal
- lss_ConfigureNode_ID
- lss_ConfigureBitTimingParameters
- lss_ActivateBitTimingParameters_master
- lss_ActivateBitTimingParameters_slave
- lss_StoreConfiguredParameters
- lss_InquireLSSAddress_master
- lss_InquireLSSAddress_slave
- lss_IdentifyRemoteSlaves
- lss_validate_address
- lss_IdentifySlave
- canSaveData
- canReadData
- nvram_open
- nvram_close
- nvram_write
- nvram_read
- led_set_state
+ _post_TPDO
+ _post_sync
+ _heartbeatError
+ _stopped
+ _operational
+ _preOperational
+ _initialisation
+ _SDOtimeoutError