From fc0ff43db2ddff98ede506ca4a545d0845334bd2 Mon Sep 17 00:00:00 2001 From: Mark Koennecke Date: Mon, 24 Feb 2014 08:40:42 +0100 Subject: [PATCH] Made SICS compile again after the move to git --- .gitignore | 120 +++++++++++++++++++++++++++++++++++++++++ hardsup/makefile_linux | 4 +- make_gen | 2 +- makefile_linux | 8 +-- scontroller.c | 2 +- sinq.c | 2 +- tabledrive.c | 2 +- tabledrive.h | 2 +- tasscan.c | 2 +- tecs/makefile_linux | 4 +- zwickroll.c | 57 ++++++++++++++++++++ 11 files changed, 192 insertions(+), 13 deletions(-) create mode 100644 .gitignore create mode 100644 zwickroll.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..087b69b --- /dev/null +++ b/.gitignore @@ -0,0 +1,120 @@ +# Took these from the https://github.com/github/gitignore project on October 21, 2011 + +# **** 'Personal' entries don't belong in here - put them in your .git/info/exclude file **** + +# Ignore text editor (e.g. emacs) autosave files +*~ + + +# Compiled Object files +*.slo +*.lo +*.o +*.obj +*.d + +# Compiled Dynamic libraries +*.so + +# Compiled Static libraries +*.lai +*.la +*.a + +# Compiled python files +*.py[co] + +# Eclipse-generated files +*.pydevproject +.project +.metadata +bin/** +tmp/** +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +*.sln +*.vcproj +*.exe +*.vcxproj +*.filters + +# User-specific files +*.suo +*.user +*.sln.docstates +*.sdf + +#Test results +*.log + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds + + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + + + +# Others +*.autosave + + +# Windows image file caches +Thumbs.db + + +# Mac OS X Finder +.DS_Store + diff --git a/hardsup/makefile_linux b/hardsup/makefile_linux index ed2141e..e2d0ec6 100644 --- a/hardsup/makefile_linux +++ b/hardsup/makefile_linux @@ -7,10 +7,10 @@ # Mark Koennecke, December 2009 #-------------------------------------------------------------------------- -include ../../linux_def +include $(SICSROOT)/sics/linux_def CC = gcc -CFLAGS = -g -DLINUX $(DFORTIFY) -I. -I../.. -MMD -Wall -Wno-unused +CFLAGS = -g -DLINUX $(DFORTIFY) -I. -I$(SICSROOT)/sics -MMD -Wall -Wno-unused include make_gen diff --git a/make_gen b/make_gen index 7c053d8..50bb9d3 100644 --- a/make_gen +++ b/make_gen @@ -47,4 +47,4 @@ dgrambroadcast.o: dgrambroadcast.h dgrambroadcast.c $(CC) $(SINQOPT) -c -g dgrambroadcast.c sinq.o: sinq.c sinq.h dgrambroadcast.h - $(CC) -I$(TCLINC) $(SINQOPT) -I../ -g -c sinq.c + $(CC) -I$(TCLINC) $(SINQOPT) -I$(SICSROOT)/sics -g -c sinq.c diff --git a/makefile_linux b/makefile_linux index 53f289a..9aa84be 100644 --- a/makefile_linux +++ b/makefile_linux @@ -5,16 +5,18 @@ # Mark Koennecke 1996-2001 # Markus Zolliker, March 2003 # Mark Koennecke, December 2009 +# Mark Koennecke, February 2014 #========================================================================== #include ../linux_def -include ../sllinux_def +include $(SICSROOT)/sics/sllinux_def CC = gcc CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -I$(TCLINC) -Ihardsup \ - -I.. -I. -MMD -DCYGNUS -DNONINTF $(DBG) $(DFORTIFY) \ - -Wall -Wno-unused -Wunused-value -Wno-comment -Wno-switch -Werror + -I$(SICSROOT)/sics -I.. -I. -MMD -DCYGNUS -DNONINTF $(DBG) \ + $(DFORTIFY) -Wall -Wno-unused -Wunused-value -Wno-comment \ + -Wno-switch -Werror EXTRA=nintf.o diff --git a/scontroller.c b/scontroller.c index 4300bbd..0091642 100644 --- a/scontroller.c +++ b/scontroller.c @@ -23,7 +23,7 @@ #include #include "rs232c_def.h" #include "el734_def.h" -#include "psi/hardsup/serialsinq.h" +#include "hardsup/serialsinq.h" #define False 0 #define True 1 diff --git a/sinq.c b/sinq.c index 5703f49..84d362e 100644 --- a/sinq.c +++ b/sinq.c @@ -31,7 +31,7 @@ #include #include "dgrambroadcast.h" -#include "sinq.h" +#include #include #ifdef SEND_PORT diff --git a/tabledrive.c b/tabledrive.c index 6700652..3a4219e 100644 --- a/tabledrive.c +++ b/tabledrive.c @@ -7,7 +7,7 @@ ---------------------------------------------------------------------------*/ #include #include -#include "../lld.h" +#include #include "tabledrive.h" /*--------------------------------------------------------------------------*/ #define OUTOFSYNC 100 diff --git a/tabledrive.h b/tabledrive.h index eced49c..e3ee6d0 100644 --- a/tabledrive.h +++ b/tabledrive.h @@ -9,7 +9,7 @@ #ifndef SICSTABLEDRIVE #define SICSTABLEDRIVE #include -#include "../motor.h" +#include /*-------------------------------------------------------------------------*/ typedef struct { diff --git a/tasscan.c b/tasscan.c index 60ac818..648b5d4 100644 --- a/tasscan.c +++ b/tasscan.c @@ -31,7 +31,7 @@ #include #include "tas.h" #include "tasu.h" -#include "../scanvar.h" +#include #include #include #include diff --git a/tecs/makefile_linux b/tecs/makefile_linux index 7d62e17..fd7acc8 100644 --- a/tecs/makefile_linux +++ b/tecs/makefile_linux @@ -5,13 +5,13 @@ # Markus Zolliker, March 2003 #-------------------------------------------------------------------------- -include ../../linux_def +include $(SICSROOT)/sics/linux_def SICS=.. CC = gcc FC = g77 -CFLAGS = -DLINUX -g $(DFORTIFY) -I../.. -I. -Wall -Wno-missing-braces -MMD +CFLAGS = -DLINUX -g $(DFORTIFY) -I$(SICSROOT)/sics -I. -Wall -Wno-missing-braces -MMD FFLAGS = -Wimplicit -g ARFLAGS = cr diff --git a/zwickroll.c b/zwickroll.c new file mode 100644 index 0000000..8973e13 --- /dev/null +++ b/zwickroll.c @@ -0,0 +1,57 @@ +/* + * zwickroll.c + * + * This is a variation of the standard AsonHandler which does not + * clear the garbage away before writing. This lead to lost data with + * the zwickroll machine. + * + * This is actually a fix rather then a solution. The Zwickroll test rig + * sends unsolicited messages. A better way to deal with this is to store them all + * in a queue which clients can inspect and consume from. Or use a callback system + * for processing incoming messages. + * + * Created on: December, 4, 2013 + * Author: koennecke + */ +#include +#include +#include + +/*----------------------------------------------------------- + * I am abusing the echo field as a flag if we are reading + * an echo char or not +-----------------------------------------------------------*/ +static int ZwickrollHandler(Ascon *a) +{ + int ret, l; + + switch(a->state){ + case AsconWriting: + l = GetDynStringLength(a->wrBuffer) - a->wrPos; + ret = AsconWriteChars(a->fd, GetCharArray(a->wrBuffer) + a->wrPos, l); + if (ret < 0) { + AsconError(a, "ASC4", errno); /* sets state to AsconFailed */ + } else { + a->wrPos += ret; + if (a->wrPos >= GetDynStringLength(a->wrBuffer)) { + a->state = AsconWriteDone; + } + } + break; + case AsconReading: + default: + return AsconStdHandler(a); + } + return 1; +} +/*------------------------------------------------------------------------*/ +void AddZwickrollProtocoll() +{ + AsconProtocol *prot = NULL; + + prot = calloc(sizeof(AsconProtocol), 1); + prot->name = strdup("zwickroll"); + prot->init = AsconStdInit; + prot->handler = ZwickrollHandler; + AsconInsertProtocol(prot); +}