-
Notifications
You must be signed in to change notification settings - Fork 0
E220 can merge #27
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
base: main
Are you sure you want to change the base?
E220 can merge #27
Conversation
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
cpplint
test/E220_vertual_rocket/E220_vertual_rocket.ino|81| Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
test/E220_can/E220_can.ino
Outdated
| static bool send_allowed = false;//送信許可 | ||
| static bool payload_semapho = false;//payloadの生成が終わるまで送信を許可しない | ||
| static uint32_t latest_send_time = 0;//最後に送信した時間 | ||
| GeneratePayload(tx_payload,payload_semapho); |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
test/E220_can/E220_can.ino
Outdated
| } | ||
| } | ||
|
|
||
| void GeneratePayload(byte* tx_payload,bool _payload_semapho){ |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
test/E220_can/E220_can.ino
Outdated
|
|
||
| switch (CCP.id) { | ||
| case CCP_nose_status: | ||
| if(CCP.str_match("OK",2)){ |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
test/E220_can/E220_can.ino
Outdated
| case CCP_nose_status: | ||
| if(CCP.str_match("OK",2)){ | ||
| status_byte|=0b10000000; | ||
| } |
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
test/E220_can/E220_can.ino
Outdated
| } | ||
| break; | ||
| case CCP_surface_pressure1_status: | ||
| if(CCP.str_match("OK",2)){ |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
| }else{ | ||
| Serial.println(""); | ||
| } | ||
|
|
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.
[cpplint] reported by reviewdog 🐶
Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]
| static bool send_allowed = false;//送信許可 | ||
| static bool payload_semapho = false;//payloadの生成が終わるまで送信を許可しない | ||
| static uint32_t latest_send_time = 0;//最後に送信した時間 | ||
| GeneratePayload(tx_payload,payload_semapho); |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
| } | ||
| } | ||
|
|
||
| void GeneratePayload(byte* tx_payload,bool _payload_semapho){ |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
| tx_payload[12] = buf.b[1]; | ||
| tx_payload[13] = buf.b[2]; | ||
| tx_payload[14] = buf.b[3]; | ||
|
|
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
| tx_payload[20] = buf.b[1]; | ||
| tx_payload[21] = buf.b[2]; | ||
| tx_payload[22] = buf.b[3]; | ||
|
|
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
|
ソフトってこんな感じでいいの?test/E220_can.inoがロケット側,test/E220_ground.inoが地上局側. |
|
Nose/Nose.inoは別のブランチでいろいろ修正済みなのでこのブランチではむししてもらってかまわん |
|
CANが繋がったXIAO RP2040のMissionInterfaceと,E220が繋がったラズピコのMainそれぞれ書いてほしい. MIFは電源のONOFFとかも管理してて,Main→MIFのUARTはアップリンクの文字列,MIF→MainのUARTはそのままパススルーしてE220に繋げるとかがいいと思う(E220からのレスポンス受け取る必要あるなら大変だけど) |
test/MIFE220/MIFcan/MIFcan.ino
Outdated
| static bool payload_semapho = false; //payloadの生成が終わるまで送信を許可しない | ||
| static uint32_t latest_send_time = 0; //最後に送信した時間 | ||
| GeneratePayload(tx_payload, payload_semapho); | ||
|
|
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
test/MIFE220/MIFcan/MIFcan.ino
Outdated
| GeneratePayload(tx_payload, payload_semapho); | ||
|
|
||
| //ToDO:tx_payloadをMain基板に送信する処理を書く | ||
|
|
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
test/MIFE220/MIFcan/MIFcan.ino
Outdated
| GeneratePayload(tx_payload, payload_semapho); | ||
|
|
||
| //ToDO:tx_payloadをMain基板に送信する処理を書く | ||
|
|
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.
[cpplint] reported by reviewdog 🐶
Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]
test/MIFE220/MainE220/MainE220.ino
Outdated
| static bool send_allowed = false; //送信許可 | ||
| static uint32_t latest_send_time = 0; //最後に送信した時間 | ||
|
|
||
| //TODO:ここにMIF基板からのデータを受け取ってtx_payloadにいれる処理を書く |
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.
[cpplint] reported by reviewdog 🐶
Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]
test/MIFE220/MainE220/MainE220.ino
Outdated
| static bool send_allowed = false; //送信許可 | ||
| static uint32_t latest_send_time = 0; //最後に送信した時間 | ||
|
|
||
| //TODO:ここにMIF基板からのデータを受け取ってtx_payloadにいれる処理を書く |
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.
[cpplint] reported by reviewdog 🐶
TODO(my_username) should be followed by a space [whitespace/todo] [2]
test/MIFE220/MainE220/MainE220.ino
Outdated
| static uint32_t latest_send_time = 0; //最後に送信した時間 | ||
|
|
||
| //TODO:ここにMIF基板からのデータを受け取ってtx_payloadにいれる処理を書く | ||
|
|
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
test/E220_ground/E220_ground.ino
Outdated
| Serial.println(surface5_pressure.f, 6); | ||
| Serial.print(","); | ||
| Serial.println(surface6_pressure.f, 6); | ||
| } |
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
test/E220_ground/E220_ground.ino
Outdated
| Serial.print(","); | ||
| Serial.println(surface6_pressure.f, 6); | ||
| } | ||
| } No newline at end of file |
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.
[cpplint] reported by reviewdog 🐶
Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]
test/E220_ground/E220_ground.ino
Outdated
| static byte rx_payload[199] = { 0 }; | ||
| int rssi = 0; | ||
| int Rxlength = 0; | ||
| Rxlength = e220.ReceiveDataVariebleLength(rx_payload,47,&rssi);//surface6_pressureまでの長さ |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
| } | ||
| if (send_allowed == true && payload_semapho == false) { | ||
| Serial.println("send!"); | ||
| e220.TransmissionDataVariebleLength(tx_payload,47); |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
| Serial.println(surface5_pressure.f, 6); | ||
| Serial.print(","); | ||
| Serial.println(surface6_pressure.f, 6); | ||
| } |
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.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
| Serial.print(","); | ||
| Serial.println(surface6_pressure.f, 6); | ||
| } | ||
| } No newline at end of file |
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.
[cpplint] reported by reviewdog 🐶
Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]
|
@771-8bit こういう感じでいかが? |
|
イメージ通りだったので結構良さそう |
test/E220_can/E220_can.ino
Outdated
|
|
||
| #define SEND_PERIOD_MS 1000 | ||
|
|
||
| E220 e220(Serial1,0xFF, 0xFF, 0x00); //TARGETADRESS=0xFFFF,CHANNEL=0x00 |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
test/E220_ground/E220_ground.ino
Outdated
|
|
||
| #define SEND_PERIOD_MS 1000 | ||
|
|
||
| E220 e220(Serial1,0xFF, 0xFF, 0x0A); //TARGETADRESS=0xFFFF,CHANNEL=0x0A=10ch=ARIB 34-35 |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
|
|
||
| #define SEND_PERIOD_MS 1000 | ||
|
|
||
| E220 e220(Serial1,0xFF, 0xFF, 0x0A); //TARGETADRESS=0xFFFF,CHANNEL=0x0A=10ch=ARIB 34-35 |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
test/MIFE220/MainE220/MainE220.ino
Outdated
| #define PAYLOAD_SIZE 47 | ||
| #define ROCKET_INSIDE_PACKET_LETTER 0x4E | ||
|
|
||
| E220 e220(Serial2,0xFF, 0xFF, 0x0A); //TARGETADRESS=0xFFFF,CHANNEL=0x0A |
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.
[cpplint] reported by reviewdog 🐶
Missing space after , [whitespace/comma] [3]
|
どうでしょう.Main基板のSerialはとりあえず1,2にしといた.そこはいい感じにマージしといて. @771-8bit |
771-8bit
left a comment
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.
@nihinihikun 見たわよ
test/MIFE220/MainE220/MainE220.ino
Outdated
| static bool comingdata = false; //MIF基板からデータが来ているか | ||
|
|
||
| //MIF基板からのデータを受け取ってtx_payloadにいれる処理 | ||
| if(Serial1.readBytesUntil(ROCKET_INSIDE_PACKET_LETTER,tx_payload,PAYLOAD_SIZE)){ |
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.
readBytesUntilはデータが来るまで待つ(orタイムアウト)ブロッキング関数だから,Serial.available()で受信バイト数読んでSerial.read()で一文字ずつ読み出して手動で終端判定するプログラムに変えてほしい.
ブロッキング関数でここで処理が止まるとMainだからまずい
test/MIFE220/MIFcan/MIFcan.ino
Outdated
| static byte tx_payload[199] = { 0 }; | ||
| static byte rocket_inside_packet[200]={0}; | ||
| static bool payload_semapho = false; //payloadの生成が終わるまで送信を許可しない | ||
| GeneratePayload(tx_payload, payload_semapho); |
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.
payload_semapho ,ポインタ渡しするかグローバルにしないと意味なくない?
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.
というか割り込みじゃないからセマフォ自体いらなそう
| GeneratePayload(tx_payload, payload_semapho); | ||
| //tx_payloadをMain基板に送信する処理 | ||
| if (payload_semapho == false) { | ||
| SendMainDataPacket(tx_payload); |
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.
これMIF→MainのUARTは爆速大量でデータ送って,Main側でダウンリンク頻度絞ってるってことよね?
Main側の処理がパンクしそうだからMIF側でデータ送信頻度絞ってほしい.
MainのプログラムはSerial_E220.write(SerialMIF.read());だけぐらいの感覚.
CAN系のデータはMIFのFlashに保存できるから大量のデータをMainに送る必要はない.
test/MIFE220/MainE220/MainE220.ino
Outdated
| comingdata = false; | ||
| } | ||
| //ここから送信処理 | ||
| if (((millis() - latest_send_time) > SEND_PERIOD_MS) && comingdata) { //前の送信から一定時間経過しているか |
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.
MIF側でダウンリンクレート絞ってるからSEND_PERIOD_MSいらないよね?
comingdataがtrueのときにすぐデータ出さないと次のループでcomingdataがfalseになるから消したい
以下確認して消してからプルリク出してください
概要
ここまで
ここまではpayloadがちゃんと受信できるかの確認.CAN→payload用の配列にいれるところは一切実機テストしてない