-
Notifications
You must be signed in to change notification settings - Fork 326
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
1.9.45 버전업 2차 #658
Merged
Merged
1.9.45 버전업 2차 #658
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
20017cf
CH340 드라이버 추가
CHOGyungChan 94e1498
Merge pull request #653 from CHOGyungChan/develop-hw
Tnks2U dcf69b2
A4 fixed
pyocoding 346cc4a
런코딩 코마크레 이미지변경_baudRate selectport삭제
andreabyfive a7d336b
Merge branch 'entrylabs:develop-hw' into develop-hw
comacre 008d5d1
이미지크기 변경
comacre 9c8935d
Merge branch 'develop-hw' of https://github.com/comacre/entry-hw into…
comacre 9a677d6
입력파트 break 구분 추가
dalgona-edu 2dad641
불필요한 테스트문 삭제
dalgona-edu 68efff2
보드 명칭 변경
dalgona-edu eeae6bc
Merge pull request #656 from dalgona-edu/develop-hw
Tnks2U 4da2072
Merge pull request #655 from comacre/develop-hw
Tnks2U bb1bbf2
Merge pull request #654 from pyocoding/develop-hw
Tnks2U 858a413
feat: cube 펌웨어 업데이트
RoboroboLab 426488c
Merge pull request #657 from RoboroboLab/develop-hw
Tnks2U File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -345,15 +345,18 @@ Module.prototype.requestLocalData = function () { | |
/* | ||
ff 55 idx size data a | ||
*/ | ||
|
||
// 펌웨어에서 입력된 값을 처리하는 Buffer | ||
Module.prototype.handleLocalData = function (data) { | ||
const self = this; | ||
const datas = this.getDataByBuffer(data); | ||
|
||
// console.log(datas); | ||
datas.forEach((data) => { | ||
if (data.length <= 4 || data[0] !== 255 || data[1] !== 85) { | ||
return; | ||
} | ||
const readData = data.subarray(2, data.length); | ||
// console.log(readData); | ||
let value; | ||
switch (readData[0]) { | ||
case self.sensorValueSize.FLOAT: { | ||
|
@@ -380,7 +383,10 @@ Module.prototype.handleLocalData = function (data) { | |
|
||
const type = readData[readData.length - 1]; | ||
const port = readData[readData.length - 2]; | ||
|
||
// if(port == 9) | ||
// { | ||
// console.log(readData); | ||
// } | ||
switch (type) { | ||
case self.sensorTypes.DIGITAL: { | ||
self.sensorData.DIGITAL[port] = value; | ||
|
@@ -408,8 +414,6 @@ Module.prototype.handleLocalData = function (data) { | |
} | ||
case self.sensorTypes.ULTRASONIC: { | ||
self.sensorData.ULTRASONIC[port] = value; | ||
// console.log(port); | ||
// console.log(self.sensorData.ULTRASONIC[port]); | ||
break; | ||
} | ||
case self.sensorTypes.DUST: { | ||
|
@@ -426,14 +430,12 @@ Module.prototype.handleLocalData = function (data) { | |
} | ||
case self.sensorTypes.RFIDTAP: { | ||
self.sensorData.RFIDTAP = value; | ||
// console.log('RFIDTAP'); | ||
// console.log(value); | ||
break; | ||
} | ||
case self.sensorTypes.RFIDVALUE: { | ||
value = value.substring(0, value.length - 1); //마지막에 쓰레기값 출력X | ||
self.sensorData.RFIDVALUE = value; | ||
// console.log(value); | ||
// console.log(readData); | ||
break; | ||
} | ||
case self.sensorTypes.MLXOBJ: { | ||
|
@@ -455,20 +457,17 @@ Module.prototype.handleLocalData = function (data) { | |
ff 55 len idx action device port slot data a | ||
0 1 2 3 4 5 6 7 8 | ||
*/ | ||
|
||
// 엔트리 블럭 화면에서 입력에 해당하는 블럭을 사용했을 때, 펌웨어쪽으로 보내는 Buffer | ||
Module.prototype.makeSensorReadBuffer = function (device, port, data) { | ||
let buffer; | ||
const dummy = new Buffer([10]); | ||
if (device == this.sensorTypes.DIGITAL) { | ||
//data 2: pull up, 0: normal | ||
//console.log(data) | ||
buffer = new Buffer([255, 85, 6, sensorIdx, this.actionTypes.GET, device, port, data, 10]); | ||
} else if (device == this.sensorTypes.PULLUP) { | ||
//data 2: pull up, 0: normal | ||
//console.log(data) | ||
//pullup인 경우 | ||
buffer = new Buffer([255, 85, 6, sensorIdx, this.actionTypes.GET, device, port, data, 10]); | ||
//console.log(buffer); | ||
} else if (device == this.sensorTypes.RFIDTAP) { | ||
buffer = new Buffer([255, 85, 5, sensorIdx, this.actionTypes.GET, device, port, 10]); | ||
} else if (device == this.sensorTypes.ULTRASONIC) { | ||
|
@@ -524,6 +523,8 @@ Module.prototype.makeSensorReadBuffer = function (device, port, data) { | |
}; | ||
|
||
//0xff 0x55 0x6 0x0 0x1 0xa 0x9 0x0 0x0 0xa | ||
|
||
// 엔트리 블럭 화면에서 출력에 해당하는 블럭을 사용했을 때, 펌웨어쪽으로 보내는 Buffer | ||
Module.prototype.makeOutputBuffer = function (device, port, data) { | ||
let buffer; | ||
const value = new Buffer(2); | ||
|
@@ -684,13 +685,12 @@ Module.prototype.makeOutputBuffer = function (device, port, data) { | |
|
||
// buffer = Buffer.from([255, 85, 26, sensorIdx, this.actionTypes.MODUEL, device, port]); | ||
// buffer = Buffer.concat([buffer, fndBlockIndex, fndClk, fndDio, fndBrightnessLev, fndOnOff, fndDisplayStrLength, fndDisplayStr0, fndDisplayStr1, fndDisplayStr2, fndDisplayStr3, fndDelayMs, dummy]); | ||
// console.log(buffer); | ||
|
||
// break; | ||
// } | ||
|
||
|
||
case this.sensorTypes.NEOPIXELINIT: { | ||
console.log('NEOPIXELINIT'); | ||
value.writeInt16LE(data); | ||
buffer = new Buffer([255, 85, 6, sensorIdx, this.actionTypes.SET, device, port]); | ||
buffer = Buffer.concat([buffer, value, dummy]); | ||
|
@@ -914,7 +914,6 @@ Module.prototype.makeOutputBuffer = function (device, port, data) { | |
case this.sensorTypes.DOTMATRIXCLEAR: { | ||
buffer = new Buffer([255, 85, 4, sensorIdx, this.actionTypes.SET, device, port]); | ||
buffer = Buffer.concat([buffer, dummy]); | ||
console.log(buffer); | ||
break; | ||
} | ||
case this.sensorTypes.LCDINIT: { | ||
|
@@ -946,7 +945,6 @@ Module.prototype.makeOutputBuffer = function (device, port, data) { | |
|
||
if ($.isPlainObject(data)) { | ||
textLen = ('' + data.text).length; | ||
// console.log(textLen); | ||
text = Buffer.from('' + data.text, 'ascii'); | ||
line.writeInt16LE(data.line); | ||
textLenBuf.writeInt16LE(textLen); | ||
|
@@ -1064,7 +1062,6 @@ Module.prototype.makeOutputBuffer = function (device, port, data) { | |
} else { | ||
num.writeFloatLE(0); | ||
} | ||
console.log(num); | ||
buffer = new Buffer([255, 85, 8, sensorIdx, this.actionTypes.SET, device, port]); | ||
buffer = Buffer.concat([buffer, num, dummy]); | ||
|
||
|
@@ -1096,6 +1093,9 @@ Module.prototype.getDataByBuffer = function (buffer) { | |
if (value == 13 && buffer[idx + 1] == 10) { | ||
datas.push(buffer.subarray(lastIndex, idx)); | ||
lastIndex = idx + 2; | ||
// if(buffer[idx-1] == 9) | ||
// console.log(datas); | ||
|
||
} | ||
}); | ||
|
||
|
@@ -1119,4 +1119,4 @@ Module.prototype.reset = function () { | |
|
||
Module.prototype.lostController = function () {}; | ||
|
||
module.exports = new Module(); | ||
module.exports = new Module(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"id": "170101", | ||
"name": { | ||
"en": "runcoding", | ||
"ko": "런코딩" | ||
"ko": "코마크레 런코딩" | ||
}, | ||
"category": "board", | ||
"platform": ["win32", "darwin"], | ||
|
@@ -17,13 +17,12 @@ | |
"email": "[email protected]", | ||
"reconnect": true, | ||
"firmware": "runcoding", | ||
"selectPort": true, | ||
"hardware": { | ||
"type": "serial", | ||
"control": "slave", | ||
"duration": 32, | ||
"vendor": ["Arduino", "wch.cn", "FTDI"], | ||
"baudRate": 115200, | ||
"baudRate": 38400, | ||
"firmwarecheck": false, | ||
"byteDelimiter": [13, 10] | ||
} | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 12 spaces but found 16.