Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

We no longer use this codegen tooling to generate can packing functions. We instead generate the messages as part of scons build script, which creates getters and setters for each field of the can message. https://uwmidsun.atlassian.net/l/cp/z0ruBZP3

Introduction

Preface

Note: codegen tooling has been merged into firmware_xiv, so some of this write-up might be outdated. See https://uwmidsun.atlassian.net/l/c/HUVz1yu7 for info about the transition.

...

How do you add new messages?

  1. In a text editor of your choice, open up can_messages.asciipb

  2. Choose a non-used message id, and fill out a message definition, following the format of the other messages

    1. Note: messages 0-9 are high priority messages, don’t use these.

    2. Code Block
      msg {
        id: 99
        source: EXAMPLE
        # target: EXAMPLE
        msg_name: "descriptive name"
        can_data {
          u8 {
            field_name_1: "blablabla"
            field_name_2: "albalbalb"
          }
        }
      }

    3. If you need enums to go along with your messages, don’t forget to add them to exported_enums.h in the firmware_xiv repo.

  3. Run make gen in the root of the repo.

    1. The generated files will be placed in the codegen-tooling-msxiv/out directory.

  4. Copy the generated files into your firmware repo at firmware-xiv/libraries/codegen-tooling/inc.

  5. Check your messages were added correctly with git diff or other, then commit and push your changes.