Compile without ethernet packets/orders and Round robin stack packets#89
Open
Cantonplas wants to merge 3 commits into
Open
Compile without ethernet packets/orders and Round robin stack packets#89Cantonplas wants to merge 3 commits into
Cantonplas wants to merge 3 commits into
Conversation
… OrderPackets work without ethernet
This will make it so that you use the general_info.json ports. Also better exceptions for the code :p
jdmarmen
approved these changes
Jun 8, 2026
victor-Lopez25
requested changes
Jun 8, 2026
Comment on lines
+20
to
+28
| #ifdef STLIB_ETH | ||
| {% for packet in packets -%} | ||
| static void {{packet.name}}_init({% for variable in packet.variables %}{{variable.type}} &{{variable.name}}{% if not loop.last %}, {% endif %}{% endfor %}) | ||
| { | ||
| {{packet.name}}_packet = new HeapPacket(static_cast<uint16_t>({{packet.id}}){% if packet.variables %}, {% for variable in packet.variables %}&{{variable.name}}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}); | ||
| {{packet.name}}_packet = new StackPacket(static_cast<uint16_t>({{packet.id}}){% if packet.variables %}, {% for variable in packet.variables %}&{{variable.name}}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}); | ||
| } | ||
|
|
||
| {% endfor -%} | ||
| #endif |
Contributor
There was a problem hiding this comment.
Instead of making this in a single #ifdef block you can inside each function put an #ifdef block to do this:
#ifdef STLIB_ETH
{{packet.name}}_packet = new StackPacket(static_cast<uint16_t>({{packet.id}}){% if packet.variables %}, {% for variable in packet.variables %}&{{variable.name}}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %});
#else
{% for variable in packet.variables %}(void){{variable.name}};{% endfor %}
#endifThis way the program using this api won't have to change if it is not using ethernet
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.