lignite 0.4.0 → 0.5.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.
Binary file
@@ -13,7 +13,7 @@ vmthread :MAIN do
13
13
  ui_draw(TEXT, FG_COLOR, 0, 50, "Raw 1")
14
14
  ui_draw(SELECT_FONT, NORMAL_FONT)
15
15
 
16
- input_device(READY_RAW, 0, PORT, 1, 0, 1, :Data1)
16
+ input_device(READY_RAW, 0, PORT, 1, 0, :Data1)
17
17
 
18
18
  and32(:Data1, 0xFFFF, :Data1)
19
19
  strings(NUMBER_FORMATTED, :Data1, "%-5d", 8, :String)
@@ -0,0 +1,36 @@
1
+ /*! \page subparexample1 Calling Subroutine with Parameters
2
+ *
3
+ * This program shows how to call byte code subroutine with parameters
4
+ *
5
+ * <hr size="1"/>
6
+ * \verbatim */
7
+
8
+ UBYTE prg[] = // p11
9
+ { //
10
+ PROGRAMHeader(0,2,2), // VersionInfo,NumberOfObjects,GlobalBytes
11
+ VMTHREADHeader(0,2), // OffsetToInstructions,LocalBytes
12
+ SUBCALLHeader(0,2), // OffsetToInstructions,LocalBytes
13
+ //
14
+ // VMTHREAD1
15
+ // {
16
+ opMOVE8_8,LC0(1),LV0(0), // LV0 = 1
17
+ opCALL,LC0(2),LC0(2),LV0(0),LV0(1), // SUBCALL(2,2,LV0,LV1)
18
+ opUI_WRITE,LC0(VALUE8),LV0(1), // UI_WRITE(VALUE8,LV1)
19
+ opUI_WRITE,LC0(PUT_STRING),LCS,'\r', // UI_WRITE(PUT_STRING,"\r\n")
20
+ '\n',0,
21
+ opUI_FLUSH, // UI_FLUSH
22
+ opOBJECT_END, // }
23
+ //
24
+ 2,IN_8,OUT_8, // SUBCALL2(InDATA8,OutDATA8)
25
+ // {
26
+ opUI_WRITE,LC0(VALUE8),LV0(0), // UI_WRITE(VALUE8,LV0)
27
+ opUI_WRITE,LC0(PUT_STRING),LCS,'\r', // UI_WRITE(PUT_STRING,"\r\n")
28
+ '\n',0,
29
+ opUI_FLUSH, // UI_FLUSH
30
+ opMOVE8_8,LV0(0),LV0(1), // LV1 = 2
31
+ opRETURN, // }
32
+ opOBJECT_END, //
33
+ };
34
+
35
+ /* \endverbatim \ref subpar "Parameter Encoding"
36
+ */
@@ -0,0 +1,20 @@
1
+ vmthread :main do
2
+ data8 :var1
3
+ data8 :var2
4
+
5
+ move8_8(1, :var1)
6
+ call(:foo, :var1, :var2)
7
+ ui_write_value8(:var2)
8
+ ui_write_put_string("\r\n")
9
+ ui_flush
10
+ end
11
+
12
+ sub :foo do
13
+ in8 :par1
14
+ out8 :par2
15
+
16
+ ui_write_value8(:par1)
17
+ ui_write_put_string("\r\n")
18
+ ui_flush
19
+ move8_8(:par1, :par2)
20
+ end
Binary file
@@ -1,4 +1,3 @@
1
-
2
1
  RSpec.configure do |config|
3
2
  config.mock_with :rspec do |mocks|
4
3
  # If you misremember a method name both in code and in tests,
@@ -30,3 +29,27 @@ end
30
29
  def datadir
31
30
  File.expand_path("../data", __FILE__)
32
31
  end
32
+
33
+ # for better displays in rspec failure diffs
34
+ def rbf_dump(bytestring, offsets: false)
35
+ lines = bytestring.bytes.map do |n|
36
+ format("0x%02x %3d %s", n, n, n.chr.inspect)
37
+ end
38
+ if offsets
39
+ lines.each_with_index do |l, i|
40
+ l.replace("#{i}: #{l}")
41
+ end
42
+ end
43
+ lines.join "\n"
44
+ end
45
+
46
+ def expect_rbf_files_same(actual_rbf, expected_rbf)
47
+ actual_bytes = File.read(actual_rbf, encoding: Encoding::BINARY)
48
+ expected_bytes = File.read(expected_rbf, encoding: Encoding::BINARY)
49
+
50
+ show_offsets = actual_bytes.bytesize == expected_bytes.bytesize
51
+ actual_dump = rbf_dump(actual_bytes, offsets: show_offsets)
52
+ expected_dump = rbf_dump(expected_bytes, offsets: show_offsets)
53
+
54
+ expect(actual_dump).to eq(expected_dump)
55
+ end
@@ -90,7 +90,7 @@ end
90
90
  def param_handler(par)
91
91
  par_type = par["type"]
92
92
  case par_type
93
- when "PAR8", "PAR16", "PAR32", "PARF"
93
+ when "PAR8", "PAR16", "PAR32", "PARF", "PARV"
94
94
  :param_simple
95
95
  when "PARNO"
96
96
  :param_multiple
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lignite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Vidner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-03 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libusb
@@ -184,6 +184,8 @@ files:
184
184
  - lib/lignite/message.rb
185
185
  - lib/lignite/motors.rb
186
186
  - lib/lignite/op_compiler.rb
187
+ - lib/lignite/parameter_declarer.rb
188
+ - lib/lignite/rbf_declarer.rb
187
189
  - lib/lignite/rbf_object.rb
188
190
  - lib/lignite/system_commands.rb
189
191
  - lib/lignite/variables.rb
@@ -203,6 +205,9 @@ files:
203
205
  - spec/data/NoDebug.lms
204
206
  - spec/data/NoDebug.rb
205
207
  - spec/data/NoDebug.rbf
208
+ - spec/data/Performance.lms
209
+ - spec/data/Performance.rb
210
+ - spec/data/Performance.rbf
206
211
  - spec/data/VernierReadout.lms
207
212
  - spec/data/VernierReadout.rb
208
213
  - spec/data/VernierReadout.rbf
@@ -212,6 +217,9 @@ files:
212
217
  - spec/data/ev3tool_stop.yml
213
218
  - spec/data/ev3tool_upload.yml
214
219
  - spec/data/everstorm.rbf
220
+ - spec/data/p11.c
221
+ - spec/data/p11.rb
222
+ - spec/data/p11.rbf
215
223
  - spec/direct_commands_spec.rb
216
224
  - spec/ev3_tool_spec.rb
217
225
  - spec/spec_helper.rb