Skip to content

Commit

Permalink
bricks/pybricks_qstrdefs.h: Only add used QSTRs.
Browse files Browse the repository at this point in the history
This ensures we don't waste space with QSTRs that aren't used.

This makes the automation idea (see removed comment) optional.
  • Loading branch information
laurensvalk committed Aug 8, 2022
1 parent a1c865a commit 91192cc
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions bricks/pybricks_qstrdefs.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,54 @@
// qstrs specific to this port
// *FORMAT-OFF*
Q(Li-ion)

#include "py/mpconfig.h"

Q(stop button pressed)
// TODO: Make these with makemoduledefs.py as it parses registered modules

#if !PYBRICKS_HUB_MOVEHUB
Q(Li-ion)
#endif

#if PYBRICKS_PY_EV3DEVICES
Q(pybricks.ev3devices)
#endif

#if PYBRICKS_PY_EXPERIMENTAL
Q(pybricks.experimental)
#endif

#if PYBRICKS_PY_GEOMETRY
Q(pybricks.geometry)
#endif

#if PYBRICKS_PY_HUBS
Q(pybricks.hubs)
#endif

#if PYBRICKS_PY_IODEVICES
Q(pybricks.iodevices)
#endif

#if PYBRICKS_PY_MEDIA
Q(pybricks.media)
#endif

#if PYBRICKS_PY_NXTDEVICES
Q(pybricks.nxtdevices)
#endif

#if PYBRICKS_PY_PARAMETERS
Q(pybricks.parameters)
#endif

#if PYBRICKS_PY_PUPDEVICES
Q(pybricks.pupdevices)
#endif

#if PYBRICKS_PY_ROBOTICS
Q(pybricks.robotics)
#endif

#if PYBRICKS_PY_TOOLS
Q(pybricks.tools)
#endif

0 comments on commit 91192cc

Please sign in to comment.