Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.5.7 #534

Merged
merged 22 commits into from
Jan 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5b4bb78
Set version to 1.5.7-alpha-2
pjewald Jan 12, 2021
174e58a
Update Sentry package.
pjewald Jan 12, 2021
18318d7
Merge pull request #523 from parallaxinc/patch-1.5.7-packages
pjewald Jan 12, 2021
6574ca1
Webpack CopyPlugin now expects an initializer object.
pjewald Jan 12, 2021
ce56dad
Merge pull request #524 from parallaxinc/patch-1.5.7-webpack-config
pjewald Jan 12, 2021
6852340
Refactor serial_receive_text. Add comments.
pjewald Jan 12, 2021
e217c40
Merge pull request #525 from parallaxinc/patch-1.5.7-solo-515
pjewald Jan 12, 2021
bb52f01
Solo-521. Remove regex expression. Refactor code block.
pjewald Jan 13, 2021
cffaabf
Merge pull request #526 from parallaxinc/patch-1.5.7-solo-521
pjewald Jan 13, 2021
64bf89e
Refactor sd_read code emitter.
pjewald Jan 16, 2021
acca24d
Merge pull request #530 from parallaxinc/solo-528
pjewald Jan 16, 2021
7902966
SD card file handle is now a global.
pjewald Jan 16, 2021
65c2a55
Merge pull request #531 from parallaxinc/solo-529
pjewald Jan 16, 2021
fbf1294
Refactor SD card blocks into separate module.
pjewald Jan 16, 2021
25ea685
Refactor SD card open.
pjewald Jan 16, 2021
c169004
Refactor warning messages.
pjewald Jan 16, 2021
f40945a
Replace '\r' with '\n'.
pjewald Jan 17, 2021
a59b101
Add SD File reserved words.
pjewald Jan 17, 2021
468acb5
Correct error in set file pointer.
pjewald Jan 17, 2021
3fcf0c1
Merge pull request #532 from parallaxinc/solo-528
pjewald Jan 17, 2021
0e0a3f8
Set release 1.5.7
pjewald Jan 17, 2021
6302293
Merge pull request #533 from parallaxinc/rel-1.5.7-final
pjewald Jan 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"homepage": "https://github.com/parallaxinc/solo#readme",
"dependencies": {
"@sentry/browser": "^5.25.0",
"@sentry/browser": "^5.29.2",
"ace-builds": "^1.4.8",
"blockly": "^2.20190722.1",
"bootbox": "^5.4.0",
Expand Down
6 changes: 6 additions & 0 deletions src/modules/blockly/generators/propc.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@ Blockly.propc.addReservedWords(
'ws2812_set,ws2812_start,ws2812_stop,ws2812_wheel,ws2812_wheel_dim,' +
'ws2812b_open,ws2812b_start');

/**
* SD File reserved words
*/
Blockly.propc.addReservedWords(
'fp,fclose,fopen,fread,fseek,ftell,fwrite,sd_init,sd_mount,');

/**
* Order of operation ENUMs.
*
Expand Down
68 changes: 41 additions & 27 deletions src/modules/blockly/generators/propc/communicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,23 +836,23 @@ Blockly.propc.console_print_multiple = function() {
orIt = '0';
}

// Get the resulting code from Blockly core
const result = Blockly.propc.valueToCode(
this, 'PRINT' + i, Blockly.propc.ORDER_NONE) || orIt;

if (!this.getFieldValue('TYPE' + i).includes('float point divide by')) {
varList += ', ' + (Blockly.propc.valueToCode(
this,
'PRINT' + i,
Blockly.propc.ORDER_NONE).replace(/%/g, '%%') || orIt);
varList += ', ' + result;
} else {
varList += ', ((float) ' + (Blockly.propc.valueToCode(
this,
'PRINT' + i,
Blockly.propc.ORDER_NONE) || orIt) +
') / ' + this.getFieldValue('DIV' + i) + '.0';
varList += ', ((float) ' + result + ') / ' +
this.getFieldValue('DIV' + i) + '.0';
}
i++;
}

if (this.getFieldValue('ck_nl') === 'TRUE') {
code += '\\r';
}

code += '"' + varList + ');\n';

// TODO: Replace .getAllBlocks() with getAllBlocksByType()
Expand Down Expand Up @@ -1527,46 +1527,60 @@ Blockly.Blocks.serial_receive_text = {
onchange: Blockly.Blocks['serial_send_text'].onchange,
};


/**
* Serial Receive Text code generator
* @return {string}
* @description Generate C source code to scan data from a serial port input.
*/
Blockly.propc.serial_receive_text = function() {
let p = '';

/* Is a serial pin defined? */
if (this.ser_pins.length > 0) {
p = this.ser_pins[0].replace(',', '_').replace(/None/g, 'N');
p = this.ser_pins[0]
.replace(',', '_') // Replace commas with underscores
.replace(/None/g, 'N'); // Replace 'None' with 'N' in all occurrences.
}

/* Get serial pins in use */
if (this.getInput('SERPIN')) {
p = this.getFieldValue('SER_PIN')
.replace(',', '_')
.replace(/None/g, 'N');
}
const allBlocks = Blockly.getMainWorkspace().getAllBlocks().toString();
if (allBlocks.indexOf('Serial initialize') === -1) {

if (! Blockly.getMainWorkspace()
.getBlocksByType('Serial initialize', false)) {
return '// ERROR: Serial is not initialized!\n';
} else {
const data = Blockly.propc.variableDB_.getName(
this.getFieldValue('VALUE'),
Blockly.VARIABLE_CATEGORY_NAME);
const data = Blockly.propc.variableDB_
.getName(this.getFieldValue('VALUE'), Blockly.VARIABLE_CATEGORY_NAME);

const type = this.getFieldValue('TYPE');
switch (this.getFieldValue('TYPE')) {
case 'BYTE':
return data + ' = fdserial_rxChar(fdser' + p + ');\n';

if (type === 'BYTE') {
return data + ' = fdserial_rxChar(fdser' + p + ');\n';
} else if (type === 'INT') {
return 'dscan(fdser' + p + ', "%d", &' + data + ');\n';
} else if (type === 'BIN') {
return 'dscan(fdser' + p + ', "%b", &' + data + ');\n';
} else if (type === 'HEX') {
return 'dscan(fdser' + p + ', "%x", &' + data + ');\n';
} else {
Blockly.propc.vartype_[data] = 'char *';
case 'INT':
return 'dscan(fdser' + p + ', "%d", &' + data + ');\n';

case 'BIN':
return 'dscan(fdser' + p + ', "%b", &' + data + ');\n';

case 'HEX':
return 'dscan(fdser' + p + ', "%x", &' + data + ');\n';

return 'dscan(fdser' + p + ', "%s", ' + data + ');\n';
case 'TEXT':
default:
Blockly.propc.vartype_[data] = 'char *';
}

// This will return a string up to the first whitespace character.
return 'dscan(fdser' + p + ', "%s", ' + data + ');\n';
}
};


/**
* Serial Status block definition
* @type {{
Expand Down
Loading