Closed martinwork closed 1 year ago
@ganicke do you happen to know if we have any docs related to this? I've definitely seen it as "yotta": { "config": { ...
but it's not my area of expertise / would have to poke around to find exact details
There are just two places where yotta
is mentioned...
pxt.json
: https://makecode.com/extensions/pxt-json...however, YottaConfig
isn't documented outside of just referring to https://docs.yottabuild.org/reference/config.html.
The settings mentioned are target specific and would need to be in a page under the target doc space or be listed in subsections of the pxt.json
page?
Yeah, I guess probably as a target specific page would make sense. That said, I'm not really sure what we'd put in their besides some broad 'it should look vaguely like this' with some samples similar to the issue post, as it's already a rare enough case anyone would want to change anything there / for the most part changes here come from a pretty specific need iirc where they'd typically be copied from existing repos or coming with changes in compiler itself
Another example using a lib config is https://github.com/microsoft/pxt-calliope/blob/f43f6567f02868f79d11fb455bf25a05a3ca0146/libs/bluetooth/pxt.json#L20
"yotta": {
"config": {
"microbit-dal": {
"bluetooth": {
"enabled": 1
}
}
}
}
Also, looking through ./cli/buildengine.ts
, it seems that extractConstants() is liking the config name of "microbit-dal"
.
Is there any documentation about setting C++ build config macros in extensions and user settings?
In particular:
This question has arisen recently in a couple of circumstances...
PR https://github.com/microsoft/pxt-microbit/pull/5202
Is it possible for an extension to change the default BLE security mode to "No pairing required" in a way that is reflected in the Project Settings UI and allows the user to override the default?
https://github.com/lancaster-university/codal-microbit-v2/issues/354
I tried following this example, but that form didn't seem to work for me. https://github.com/microsoft/pxt-microbit/blob/c6a9d193378b90753be0a9b3d21fd40c4f013b09/libs/cpp-test/pxt.json#L9
This form seems to be more common, and works for my example, but I didn't expect to need to wrap CODAL settings in "yotta". https://github.com/microsoft/pxt-common-packages/blob/47c24ccc95330be6b8193cf2636a9dbee7015a80/libs/mouse/pxt.json#L17
I also found https://github.com/microsoft/pxt-common-packages/blob/47c24ccc95330be6b8193cf2636a9dbee7015a80/libs/core/pxt.json#L46