Repository: incubator-mynewt-core Updated Branches: refs/heads/bluetooth5 958bce0a5 -> 2446dcb64
bsp: wifire: Implement hal_bsp_hw_id This function reads the DEVID register which contains the revision (upper 4 bits) and the device id (lower 28 bits). Signed-off-by: Francois Berder <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/e278c351 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e278c351 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e278c351 Branch: refs/heads/bluetooth5 Commit: e278c351183310a3883f5255c856b6184e6d9cec Parents: debf64f Author: Francois Berder <[email protected]> Authored: Mon May 8 11:31:17 2017 +0200 Committer: Francois Berder <[email protected]> Committed: Mon May 8 11:34:13 2017 +0200 ---------------------------------------------------------------------- hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e278c351/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c b/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c index 87fcfa6..ae78a1d 100644 --- a/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c +++ b/hw/bsp/pic32mz2048_wi-fire/src/hal_bsp.c @@ -19,9 +19,21 @@ #include "hal/hal_bsp.h" #include "bsp/bsp.h" #include <assert.h> +#include <xc.h> const struct hal_flash * hal_bsp_flash_dev(uint8_t id) { return 0; } + +int +hal_bsp_hw_id(uint8_t *id, int max_len) +{ + if (max_len > sizeof(DEVID)) { + max_len = sizeof(DEVID); + } + + memcpy(id, &DEVID, max_len); + return max_len; +} \ No newline at end of file
