Skip to content

Commit 50abfc2

Browse files
app: Extend 'local sensors' build to have dev and non-dev builds.
1 parent 724069c commit 50abfc2

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

build_all.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def main():
6262
clean_build(ROOT_DIR, "radio-bridge-dev.hex", build_flags={"PROJECT_BUILD_TYPE": "5"})
6363
clean_build(ROOT_DIR, "radio-remote.hex", build_flags={"PROJECT_BUILD_TYPE": "2"})
6464
clean_build(ROOT_DIR, "radio-bridge.hex", build_flags={"PROJECT_BUILD_TYPE": "4"})
65-
clean_build(ROOT_DIR, "local-sensors.hex", build_flags={"PROJECT_BUILD_TYPE": "1"})
65+
clean_build(ROOT_DIR, "local-sensors-dev.hex", build_flags={"PROJECT_BUILD_TYPE": "1"})
66+
clean_build(ROOT_DIR, "local-sensors.hex", build_flags={"PROJECT_BUILD_TYPE": "6"})
6667

6768

6869
if __name__ == '__main__':

source/main.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,13 @@ int setRemoteMbId(sbp_state_s *protocol_state) {
111111
}
112112

113113
/**
114-
* @brief Get the Radio Frequency from Non Volatile Memory, or the default
115-
* value if not set in NVM.
114+
* @brief Retrieves the remote micro:bit ID from Non Volatile Memory (NVM).
116115
*
117-
* The default value, if noting stored in NVM, will be the unique ID from
116+
* The default value, if nothing stored in NVM, will be the unique ID from
118117
* this micro:bit. This is statistically less likely to match the remote ID
119118
* than picking a number like 0.
120119
*
121-
* @return The radio frequency.
120+
* @return The stored remote micro:bit ID.
122121
*/
123122
uint32_t getRemoteMbId() {
124123
uint32_t *stored_remote_mb_id = (uint32_t *)REMOTE_MB_ID_ADDR;

source/main.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,26 @@ extern MicroBit uBit;
88

99
// The project type build flags will be configured via the build_all.py script
1010
// no need to edit any of the macros below
11-
#define BUILD_LOCAL_SENSORS 1
11+
#define BUILD_LOCAL_SENSORS 6
12+
#define BUILD_LOCAL_SENSORS_DEV 1
1213
#define BUILD_RADIO_REMOTE 2
1314
#define BUILD_RADIO_REMOTE_DEV 3
1415
#define BUILD_RADIO_BRIDGE 4
1516
#define BUILD_RADIO_BRIDGE_DEV 5
1617

1718

1819
#ifndef PROJECT_BUILD_TYPE
19-
#define PROJECT_BUILD_TYPE BUILD_LOCAL_SENSORS
20+
#define PROJECT_BUILD_TYPE BUILD_LOCAL_SENSORS_DEV
2021
#endif
2122

2223
#if PROJECT_BUILD_TYPE == BUILD_LOCAL_SENSORS
2324
#define RADIO_REMOTE 0
2425
#define RADIO_BRIDGE 0
26+
#define DEV_MODE 0
27+
#define IMG_RUNNING IMG_SQUARE
28+
#elif PROJECT_BUILD_TYPE == BUILD_LOCAL_SENSORS_DEV
29+
#define RADIO_REMOTE 0
30+
#define RADIO_BRIDGE 0
2531
#define DEV_MODE 1
2632
#define IMG_RUNNING IMG_STAIRS
2733
#elif PROJECT_BUILD_TYPE == BUILD_RADIO_REMOTE

0 commit comments

Comments
 (0)