Skip to content

Commit

Permalink
remove CSynth and change file extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlombardo authored and nwdepatie committed Apr 10, 2024
1 parent bc23688 commit 19dbb72
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 169 deletions.
160 changes: 0 additions & 160 deletions cangen/CSynth.py

This file was deleted.

1 change: 0 additions & 1 deletion cangen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from cangen.RustSynth import RustSynth
from cangen.CSynth import CSynth
from cangen.YAMLParser import YAMLParser
from cangen.CANField import CANField
from cangen.Format import Format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
This is a Jinja template, everything in {{ }} or {% %} brackets is replaced with C code.
Code inside brackets are Python snippets.
Pro tip: dont use tabs in C code, replace them with four spaces (tabs cause weird formatting issues).
Note: dont use tabs in C code, replace them with four spaces (tabs cause weird formatting issues).
This file creates the decoder functions given a list of CANMsg objects.
-#}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
This is a Jinja template, everything in {{ }} or {% %} brackets is replaced with C code.
Code inside brackets are Python snippets.
Pro tip: dont use tabs in C code, replace them with four spaces (tabs cause weird formatting issues).
Note: dont use tabs in C code, replace them with four spaces (tabs cause weird formatting issues).
This file creates the encoder functions given a list of CANMsg obejcts.
-#}


{% import "macros.j2" as macros -%}
{% import EMBEDDED_BASE_PATH + "/cangen/templates/macros.j2" as macros -%}


{% for msg in can_msgs %}
Expand Down
3 changes: 0 additions & 3 deletions cangen/templates/imports.c

This file was deleted.

12 changes: 12 additions & 0 deletions cangen/templates/imports.c.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{#
This is a Jinja template, everything in {{ }} or {% %} brackets is replaced with C code.
Code inside brackets are Python snippets.
Note: dont use tabs in C code, replace them with four spaces (tabs cause weird formatting issues).
This file defines the imports used by the templates.
-#}

#include <stdio.h>
#include <stdint.h>
#include "can.h"
8 changes: 8 additions & 0 deletions cangen/templates/macros.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{#
This is a Jinja template, everything in {{ }} or {% %} brackets is replaced with C code.
Code inside brackets are Python snippets.
This file defines macros to be used by other templates.
-#}


{#
convert msg description to a function name that can be used by can
-#}
Expand Down
6 changes: 4 additions & 2 deletions cangen/templates/routers.c → cangen/templates/routers.c.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
This is a Jinja template, everything in {{ }} or {% %} brackets is replaced with C code.
Code inside brackets are Python snippets.
Pro tip: dont use tabs in C code, replace them with four spaces (tabs cause weird formatting issues).
Note: dont use tabs in C code, replace them with four spaces (tabs cause weird formatting issues).
This file creates the switch statement for decoding a CAN message of type can_msg_t.
-#}


{% import "macros.j2" as macros -%}
{% import EMBEDDED_BASE_PATH + "/cangen/templates/macros.j2" as macros -%}


{#-
Expand Down

0 comments on commit 19dbb72

Please sign in to comment.