Skip to content

Commit 508c95e

Browse files
committed
Merge pull request #1 from msarahan/master
Seconds setting bug fix
2 parents a81d43a + 4be7731 commit 508c95e

File tree

8 files changed

+29
-24
lines changed

8 files changed

+29
-24
lines changed

.cproject

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<builder buildPath="${workspace_loc:/FBS/Debug}" id="com.xmos.cdt.builder.debug.1523134849" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.xmos.cdt.builder.debug"/>
2323
<tool id="com.xmos.cdt.archiver.base.1314904928" name="Archiver" superClass="com.xmos.cdt.archiver.base"/>
2424
<tool id="com.xmos.cdt.linker.debug.1195325352" name="Mapper/Linker" superClass="com.xmos.cdt.linker.debug">
25+
<option id="com.xmos.cdt.linker.options.target.88364695" superClass="com.xmos.cdt.linker.options.target" value="com.xmos.cdt.linker.options.target.XC-1A" valueType="enumerated"/>
2526
<inputType id="com.xmos.cdt.linker.input.447046198" superClass="com.xmos.cdt.linker.input">
2627
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
2728
</inputType>
@@ -993,6 +994,7 @@
993994
</profile>
994995
</scannerConfigBuildInfo>
995996
</storageModule>
997+
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
996998
</cconfiguration>
997999
<cconfiguration id="com.xmos.cdt.xeproject.release.289809098">
9981000
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.xmos.cdt.xeproject.release.289809098" moduleId="org.eclipse.cdt.core.settings" name="Release">
@@ -1013,6 +1015,7 @@
10131015
<builder buildPath="${workspace_loc:/FBS/Release}" id="com.xmos.cdt.builder.release.815212787" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.xmos.cdt.builder.release"/>
10141016
<tool id="com.xmos.cdt.archiver.base.1541204834" name="Archiver" superClass="com.xmos.cdt.archiver.base"/>
10151017
<tool id="com.xmos.cdt.linker.release.327851151" name="Mapper/Linker" superClass="com.xmos.cdt.linker.release">
1018+
<option id="com.xmos.cdt.linker.options.target.1321950921" name="Target" superClass="com.xmos.cdt.linker.options.target" value="com.xmos.cdt.linker.options.target.XC-1A" valueType="enumerated"/>
10161019
<inputType id="com.xmos.cdt.linker.input.1418655161" superClass="com.xmos.cdt.linker.input">
10171020
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
10181021
</inputType>
@@ -1982,6 +1985,7 @@
19821985
</profile>
19831986
</scannerConfigBuildInfo>
19841987
</storageModule>
1988+
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
19851989
</cconfiguration>
19861990
<cconfiguration id="com.xmos.cdt.xeproject.debug.1567289560.2145781974">
19871991
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.xmos.cdt.xeproject.debug.1567289560.2145781974" moduleId="org.eclipse.cdt.core.settings" name="1.1_debug">
@@ -2971,6 +2975,7 @@
29712975
</profile>
29722976
</scannerConfigBuildInfo>
29732977
</storageModule>
2978+
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
29742979
</cconfiguration>
29752980
<cconfiguration id="com.xmos.cdt.xeproject.release.289809098.1286400171">
29762981
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.xmos.cdt.xeproject.release.289809098.1286400171" moduleId="org.eclipse.cdt.core.settings" name="1.1_release">
@@ -3960,6 +3965,7 @@
39603965
</profile>
39613966
</scannerConfigBuildInfo>
39623967
</storageModule>
3968+
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
39633969
</cconfiguration>
39643970
<cconfiguration id="com.xmos.cdt.xeproject.release.289809098.1286400171.15093232">
39653971
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.xmos.cdt.xeproject.release.289809098.1286400171.15093232" moduleId="org.eclipse.cdt.core.settings" name="1.2_release">
@@ -4949,6 +4955,7 @@
49494955
</profile>
49504956
</scannerConfigBuildInfo>
49514957
</storageModule>
4958+
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
49524959
</cconfiguration>
49534960
</storageModule>
49544961
<storageModule moduleId="cdtBuildSystem" version="4.0.0">

Debug/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ endif
4444
all: FBS.xe
4545

4646
# Tool invocations
47-
FBS.xe: $(OBJS) $(XN_SRCS) $(XTA_SRCS)
47+
FBS.xe: $(OBJS) $(XTA_SRCS)
4848
@echo 'Building target: $@'
4949
@echo 'Invoking: Mapper/Linker'
50-
xcc -Werror=timing-syntax -o FBS.xe $(OBJS) $(LIBS) $(XN_SRCS) $(XTA_SRCS)
50+
xcc -target=XC-1A -Werror=timing-syntax -o FBS.xe $(OBJS) $(LIBS) $(XTA_SRCS)
5151
@echo 'Finished building target: $@'
5252
@echo ' '
5353

Debug/sources.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ S_SRCS :=
1111
XC_SRCS :=
1212
XTA_SRCS :=
1313
CXX_SRCS :=
14-
XN_SRCS :=
1514
C++_SRCS :=
1615
CC_SRCS :=
1716
C++_DEPS :=
@@ -27,5 +26,4 @@ C_UPPER_DEPS :=
2726
# Every subdirectory with source files must be described here
2827
SUBDIRS := \
2928
src \
30-
. \
3129

Debug/src/subdir.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ XC_DEPS += \
1717
src/%.o: ../src/%.xc
1818
@echo 'Building file: $<'
1919
@echo 'Invoking: XC Compiler'
20-
xcc -O0 -g -Wall -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@ " -o $@ "$<" "../XC-1A.xn"
20+
xcc -O0 -g -Wall -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@ " -target=XC-1A -o $@ "$<"
2121
@echo 'Finished building: $<'
2222
@echo ' '
2323

Release/makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ RM = del /q $(subst /,\,$(1))
1010
-include sources.mk
1111
-include subdir.mk
1212
-include src/subdir.mk
13-
-include SerialPlugin/subdir.mk
1413
-include objects.mk
1514

1615
ifneq ($(MAKECMDGOALS),clean)
@@ -45,10 +44,10 @@ endif
4544
all: FBS.xe
4645

4746
# Tool invocations
48-
FBS.xe: $(OBJS) $(XN_SRCS) $(XTA_SRCS)
47+
FBS.xe: $(OBJS) $(XTA_SRCS)
4948
@echo 'Building target: $@'
5049
@echo 'Invoking: Mapper/Linker'
51-
xcc -Werror=timing-syntax -o FBS.xe $(OBJS) $(LIBS) $(XN_SRCS) $(XTA_SRCS)
50+
xcc -target=XC-1A -Werror=timing-syntax -o FBS.xe $(OBJS) $(LIBS) $(XTA_SRCS)
5251
@echo 'Finished building target: $@'
5352
@echo ' '
5453

Release/sources.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ S_SRCS :=
1111
XC_SRCS :=
1212
XTA_SRCS :=
1313
CXX_SRCS :=
14-
XN_SRCS :=
1514
C++_SRCS :=
1615
CC_SRCS :=
1716
C++_DEPS :=
@@ -27,6 +26,4 @@ C_UPPER_DEPS :=
2726
# Every subdirectory with source files must be described here
2827
SUBDIRS := \
2928
src \
30-
. \
31-
SerialPlugin \
3229

Release/src/subdir.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ XC_DEPS += \
1717
src/%.o: ../src/%.xc
1818
@echo 'Building file: $<'
1919
@echo 'Invoking: XC Compiler'
20-
xcc -O2 -g -Wall -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@ " -o $@ "$<" "../XC-1A.xn"
20+
xcc -O2 -g -Wall -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@ " -target=XC-1A -o $@ "$<"
2121
@echo 'Finished building: $<'
2222
@echo ' '
2323

src/fbsMT.xc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ void setDelay(int time, unsigned char units, out port out_port, unsigned char si
474474
}
475475
case 109: //milliseconds, lower-case m
476476
{
477+
// 1E5 cycles/msec
477478
ticks=time*100000;
478479
out_port <: signal;
479480
wait(ticks);
@@ -482,32 +483,35 @@ void setDelay(int time, unsigned char units, out port out_port, unsigned char si
482483
}
483484
case 115: //seconds, lower-case s
484485
{
485-
// if time is longer than 30 seconds, the counter is in danger of overflow.
486-
// to avoid this, divide by 30, and wait in multiples of 30 seconds, then
486+
// if time is longer than 2 seconds, the counter is in danger of overflow.
487+
// to avoid this, divide by 2 and wait in multiples of 2 seconds, then
487488
// finally wait for the remainder time.
488-
if (time>20) {
489-
carry=time/20;
489+
if (time>2) {
490+
carry=time/2;
490491
}
491492

492493
out_port <: signal;
493-
for (int cnt = 0; cnt < carry; cnt += 1){
494-
// wait 20 sec
495-
wait(2000000000);
494+
ticks = 2*100*1000*1000;
495+
for (int cnt = 0; cnt < carry; cnt++){
496+
// wait 2 sec
497+
// 1E8 cycles/sec
498+
wait(ticks);
496499
}
497500
// wait remainder seconds
498-
wait(time*100000000%20);
501+
ticks = (time%2)*100*1000*1000;
502+
wait(ticks);
499503
// output end state
500504
out_port <: endstate;
501505
break;
502506
}
503507
case 77: //minutes, captial M
504508
{
505-
// wait in multiples of 20 seconds (three intervals per minute)
506-
carry=time*3;
509+
// wait in multiples of 2 seconds (three intervals per minute)
510+
carry=time*30;
507511
out_port <: signal;
508512
for (int cnt = 0; cnt < carry; cnt += 1){
509-
// wait 20 sec
510-
wait(2000000000);
513+
// wait 2 sec
514+
wait(2*100*1000*1000);
511515
}
512516
out_port <: endstate;
513517
break;

0 commit comments

Comments
 (0)