Skip to content

Commit

Permalink
apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
meltingrabbit committed Mar 8, 2022
1 parent 3c2f3ba commit 3e78881
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion my_mod/tlm_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ def GenerateTlmBuffer(settings, other_obc_dbs):
body_c += "{{\n"
body_c += " const CommonTlmPacket* buffered_packet;\n"
body_c += "\n"
body_c += " if (tlm_id >= {_obc_name_upper}_MAX_TLM_NUM) return TF_TLM_FUNC_ACK_NOT_DEFINED;\n"
body_c += (
" if (tlm_id >= {_obc_name_upper}_MAX_TLM_NUM) return TF_TLM_FUNC_ACK_NOT_DEFINED;\n"
)
body_c += (
" if ("
+ driver_name
Expand Down
22 changes: 18 additions & 4 deletions my_mod/tlm_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ def GenerateTlmDef(settings, tlm_db, other_obc_dbs):
# "static TF_TLM_FUNC_ACK OBC_(uint8_t* packet, uint16_t* len, uint16_t max_len);"
# " OBC_ID = 0x00,"
for tlm in tlm_db:
body_c += "static TF_TLM_FUNC_ACK Tlm_" + tlm["tlm_name"].upper() + "_(uint8_t* packet, uint16_t* len, uint16_t max_len);\n"
body_c += (
"static TF_TLM_FUNC_ACK Tlm_"
+ tlm["tlm_name"].upper()
+ "_(uint8_t* packet, uint16_t* len, uint16_t max_len);\n"
)
body_h += " Tlm_CODE_" + tlm["tlm_name"].upper() + " = " + tlm["tlm_id"] + ",\n"

if settings["is_main_obc"]:
Expand Down Expand Up @@ -95,7 +99,11 @@ def GenerateTlmDef(settings, tlm_db, other_obc_dbs):
func_code += "(&packet[" + str(pos) + "], " + code + ");\n"

body_c += "\n"
body_c += "static TF_TLM_FUNC_ACK Tlm_" + tlm["tlm_name"].upper() + "_(uint8_t* packet, uint16_t* len, uint16_t max_len)\n"
body_c += (
"static TF_TLM_FUNC_ACK Tlm_"
+ tlm["tlm_name"].upper()
+ "_(uint8_t* packet, uint16_t* len, uint16_t max_len)\n"
)
body_c += "{\n"
for local_var in tlm["local_vars"]:
body_c += " " + local_var + "\n"
Expand Down Expand Up @@ -134,7 +142,9 @@ def GetTlmDefCOfOtherObcFunDef_(settings, tlm_db, other_obc_dbs):
temp_c += "// {_obc_name_upper} TLM\n"
for tlm in oter_obc_tlm_db:
temp_c += (
"static TF_TLM_FUNC_ACK Tlm_" + tlm["tlm_name"].upper() + "_(uint8_t* packet, uint16_t* len, uint16_t max_len);\n"
"static TF_TLM_FUNC_ACK Tlm_"
+ tlm["tlm_name"].upper()
+ "_(uint8_t* packet, uint16_t* len, uint16_t max_len);\n"
)

body_c += temp_c.format(
Expand Down Expand Up @@ -193,7 +203,11 @@ def GetTlmDefCOfOtherObcFunBody_(settings, tlm_db, other_obc_dbs):
tlm_name_upper = tlm_name.upper()
# tlm_name_lower = tlm_name.lower()
temp_c += "\n"
temp_c += "static TF_TLM_FUNC_ACK Tlm_" + tlm_name_upper + "_(uint8_t* packet, uint16_t* len, uint16_t max_len)\n"
temp_c += (
"static TF_TLM_FUNC_ACK Tlm_"
+ tlm_name_upper
+ "_(uint8_t* packet, uint16_t* len, uint16_t max_len)\n"
)
temp_c += "{{\n"
temp_c += (
" return {_obc_name_upper}_pick_up_tlm_buffer("
Expand Down

0 comments on commit 3e78881

Please sign in to comment.