mbed-os-examples
/
mbed-os-example-mbed5-sys-info
Example to get the System Information from Mbed OS
Diff: main.cpp
- Revision:
- 19:907415fb0a88
- Parent:
- 18:84717aecb01a
--- a/main.cpp Tue Nov 27 04:45:35 2018 +0000 +++ b/main.cpp Wed Feb 13 18:37:42 2019 +0000 @@ -1,3 +1,19 @@ +/* Copyright (c) 2018 Arm Limited +* +* SPDX-License-Identifier: Apache-2.0 +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ #include "mbed.h" #if !defined(MBED_SYS_STATS_ENABLED) @@ -44,12 +60,12 @@ /* RAM / ROM memory start and size information */ for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) { if (stats.ram_size[i] != 0) { - printf("RAM%d: Start 0x%x Size: 0x%x \n",i , stats.ram_start[i], stats.ram_size[i]); + printf("RAM%d: Start 0x%lx Size: 0x%lx \n", i, stats.ram_start[i], stats.ram_size[i]); } } for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) { if (stats.rom_size[i] != 0) { - printf("ROM%d: Start 0x%x Size: 0x%x \n",i, stats.rom_start[i], stats.rom_size[i]); + printf("ROM%d: Start 0x%lx Size: 0x%lx \n", i, stats.rom_start[i], stats.rom_size[i]); } } return 0;