sfrp 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f403d50150a6bce3cd4de441f4b19e2e1efdd0e
4
- data.tar.gz: df10a8975ed95471ed17a0739c2bab08972d23aa
3
+ metadata.gz: f6897d573bd2d15ba44f623074ef43617750fdf2
4
+ data.tar.gz: 334e53df57d58b0f7e3af00f69fbe73b9703a514
5
5
  SHA512:
6
- metadata.gz: 1525b31400335ddbe6cbc72370cae93b181b9721f0aac45b75b69af4110badc8ca54adceeecfecd0bfd3248921a4910877725d72f987442b5db5129d1fadabd6
7
- data.tar.gz: fe1cb578b41a2897460cc949ee85bfb0b92a8b30b0a2f3b1739535c7b1d637d91fac83e6f2b0fc42a8007deba76b7c6dc97884f2797a29e595bf10526ffb2d1f
6
+ metadata.gz: f838cd62f2ca8600c6d0ecf65ab8b860d894866b007b1ccbb18eef5351ff0a127dee4beb8cfaee5c53b22f246189de2010a61369c9afe2ecc14b25c672c136e4
7
+ data.tar.gz: 28b5e7c80011038b53069d476aba55b54bb77ff8cf2b7304fdf2ee4b83e3fa633756daa7918aa301872993297d79eafc8efeb7fdcb86faa8fb7641b483eaef93
@@ -0,0 +1,29 @@
1
+ #include<avr/io.h>
2
+ #include <avr/interrupt.h>
3
+
4
+ static unsigned int elapsed_time_counter = 0;
5
+
6
+ ISR(TIMER0_OVF_vect)
7
+ {
8
+ elapsed_time_counter++;
9
+ }
10
+
11
+ void initialize() {
12
+ cli();
13
+ TIMSK = 0b00000001;
14
+ //TCCR0 = 0b00000011;
15
+ TCCR0 = 0b00000010;
16
+ sei();
17
+ }
18
+
19
+ int elapsed_time() {
20
+ static int initial = 1;
21
+ int res;
22
+ if (initial) {
23
+ initialize();
24
+ initial = 0;
25
+ }
26
+ res = elapsed_time_counter * 2;
27
+ elapsed_time_counter = 0;
28
+ return res;
29
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef TIMER_H
2
+ #define TIMER_H
3
+
4
+ int elapsed_time();
5
+
6
+ #endif
@@ -0,0 +1,4 @@
1
+ import Base
2
+
3
+ foreign elapsed_time as $elapsedTime() : Int
4
+ in @elapsedTime from $elapsedTime()
File without changes
File without changes
File without changes
data/lib/sfrp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SFRP
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -1,5 +1,5 @@
1
1
  import Base
2
- import IO.STDIO as SIO
2
+ import Base.IO.STDIO as SIO
3
3
 
4
4
  foreign init as $initProgram(Int) : Unit
5
5
  init $initProgram(0)
@@ -1,5 +1,5 @@
1
1
  import Base
2
- import IO.STDIO as SIO
2
+ import Base.IO.STDIO as SIO
3
3
  import SubDir.Lib as Lib
4
4
 
5
5
  in @maybeInt : Maybe[Int] from Lib.$getMaybeInt()
@@ -1,5 +1,5 @@
1
1
  import Base
2
- import IO.STDIO as SIO
2
+ import Base.IO.STDIO as SIO
3
3
 
4
4
  $getMaybeInt() : Maybe[Int] = case SIO.$getIntPair() of
5
5
  (0, _) -> Nothing
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfrp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kensuke Sawada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2016-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -168,12 +168,15 @@ files:
168
168
  - README.md
169
169
  - Rakefile
170
170
  - base-library/Base.sfrp
171
- - base-library/IO/AVR/ATMEGA8.c
172
- - base-library/IO/AVR/ATMEGA8.h
173
- - base-library/IO/AVR/ATMEGA8.sfrp
174
- - base-library/IO/STDIO.c
175
- - base-library/IO/STDIO.h
176
- - base-library/IO/STDIO.sfrp
171
+ - base-library/Base/IO/AVR/ATMEGA8/GPIO.c
172
+ - base-library/Base/IO/AVR/ATMEGA8/GPIO.h
173
+ - base-library/Base/IO/AVR/ATMEGA8/GPIO.sfrp
174
+ - base-library/Base/IO/AVR/ATMEGA8/Timer.c
175
+ - base-library/Base/IO/AVR/ATMEGA8/Timer.h
176
+ - base-library/Base/IO/AVR/ATMEGA8/Timer.sfrp
177
+ - base-library/Base/IO/STDIO.c
178
+ - base-library/Base/IO/STDIO.h
179
+ - base-library/Base/IO/STDIO.sfrp
177
180
  - bin/sfrp
178
181
  - lib/sfrp.rb
179
182
  - lib/sfrp/command.rb