@@ -143,12 +143,22 @@ export default function (Generator) {
143
143
} ;
144
144
145
145
Generator . microbitMore_getPinEventTimestamp = function ( block ) {
146
- block . isStatement = true ;
147
146
const pin = Generator . valueToCode ( block , 'PIN' , Generator . ORDER_NONE ) || null ;
148
147
const event = Generator . getFieldValue ( block , 'EVENT' ) || null ;
149
148
return `microbit_more.get_pin_event_timestamp(${ pin } , ${ event } )\n` ;
150
149
} ;
151
150
151
+ Generator . microbitMore_getSharedData = function ( block ) {
152
+ const index = Generator . valueToCode ( block , 'INDEX' , Generator . ORDER_NONE ) || null ;
153
+ return `microbit_more.get_shared_data(${ index } )\n` ;
154
+ } ;
155
+
156
+ Generator . microbitMore_setSharedData = function ( block ) {
157
+ const index = Generator . valueToCode ( block , 'INDEX' , Generator . ORDER_NONE ) || null ;
158
+ const value = Generator . valueToCode ( block , 'VALUE' , Generator . ORDER_NONE ) || null ;
159
+ return `microbit_more.get_shared_data(${ index } , ${ value } )\n` ;
160
+ } ;
161
+
152
162
Generator . microbitMore_menu_buttons = function ( block ) {
153
163
const buttons = Generator . quote_ ( Generator . getFieldValue ( block , 'buttons' ) || 'A' ) ;
154
164
return [ buttons , Generator . ORDER_ATOMIC ] ;
@@ -209,6 +219,16 @@ export default function (Generator) {
209
219
return [ pinEventTimestampMenu , Generator . ORDER_ATOMIC ] ;
210
220
} ;
211
221
222
+ Generator . microbitMore_menu_sharedDataIndex = function ( block ) {
223
+ const sharedDataIndex = Generator . getFieldValue ( block , 'sharedDataIndex' ) || 'absolute' ;
224
+ return [ sharedDataIndex , Generator . ORDER_ATOMIC ] ;
225
+ } ;
226
+
227
+ Generator . microbitMore_menu_axis = function ( block ) {
228
+ const axis = Generator . getFieldValue ( block , 'axis' ) || '0' ;
229
+ return [ axis , Generator . ORDER_ATOMIC ] ;
230
+ } ;
231
+
212
232
Generator . matrix = function ( block ) {
213
233
let matrix = Generator . getFieldValue ( block , 'MATRIX' ) || '0000000000000000000000000' ;
214
234
matrix = matrix . replace ( / 0 / g, '.' ) ;
0 commit comments