/* * This file is part of the µOS++ distribution. * (https://github.com/micro-os-plus) * Copyright (c) 2014 Liviu Ionescu. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ // ---------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include // ---------------------------------------------------------------------------- // // Standalone STM32F4 empty sample (trace via DEBUG). // // Trace support is enabled by adding the TRACE macro definition. // By default the trace messages are forwarded to the DEBUG output, // but can be rerouted to any device or completely suppressed, by // changing the definitions required in system/src/diag/trace_impl.c // (currently OS_USE_TRACE_ITM, OS_USE_TRACE_SEMIHOSTING_DEBUG/_STDOUT). // // ----- main() --------------------------------------------------------------- // Sample pragmas to cope with warnings. Please note the related line at // the end of this function, used to pop the compiler diagnostics status. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wmissing-declarations" #pragma GCC diagnostic ignored "-Wreturn-type" using namespace std; typedef unsigned short uint16_t; #ifndef uint32_t typedef unsigned long uint32_t; #endif #ifndef uint64_t typedef unsigned long long uint64_t; #endif char* string_tab[16] = { "string0", "string1", "string2", "string3", "string4", "string5", "string6", "string7", "string8", "string9", "string10", "string11", "string12", "string13", "string14", "string15" }; char char_tab[16] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'}; uint16_t short_tab[16] = { 0x0, 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888, 0x9999, 0xAAAA, 0xBBBB, 0xCCCC, 0xDDDD, 0xEEEE, 0xFFFF }; uint32_t long_tab[16] = { 0x0, 0x11111111, 0x22222222, 0x33333333, 0x44444444, 0x55555555, 0x66666666, 0x77777777, 0x88888888, 0x99999999, 0xAAAAAAAA, 0xBBBBBBBB, 0xCCCCCCCC, 0xDDDDDDDD, 0xEEEEEEEE, 0xFFFFFFFF }; vector vC; vector vStr; vector vS; vector vL; set sC; set sStr; set sS; set sL; map mC_Str; map mC_S; map mC_L; list lC; list lStr; list lS; list lL; deque dC; deque dStr; deque dS; deque dL; queue qC; queue qStr; queue qS; queue qL; stack stC; stack stStr; stack stS; stack stL; void loc() { vector vlL; queue qlL; map mlC_L; int i; for(i=0; i<16; i++) { vlL.push_back(long_tab[i]); qlL.push(long_tab[i]); mlC_L.insert(pair(char_tab[i] ,long_tab[i])); } } int main() { int i; for(i=0; i<16; i++) { vC.push_back(char_tab[i]); vStr.push_back(string_tab[i]); vS.push_back(short_tab[i]); vL.push_back(long_tab[i]); sC.insert(char_tab[i]); sStr.insert(string_tab[i]); sS.insert(short_tab[i]); sL.insert(long_tab[i]); mC_Str.insert(pair(char_tab[i] ,string_tab[i])); mC_S.insert(pair(char_tab[i] ,short_tab[i])); mC_L.insert(pair(char_tab[i] ,long_tab[i])); lC.push_back(char_tab[i]); lStr.push_back(string_tab[i]); lS.push_back(short_tab[i]); lL.push_back(long_tab[i]); dC.push_back(char_tab[i]); dStr.push_back(string_tab[i]); dS.push_back(short_tab[i]); dL.push_back(long_tab[i]); qC.push(char_tab[i]); qStr.push(string_tab[i]); qS.push(short_tab[i]); qL.push(long_tab[i]); stC.push(char_tab[i]); stStr.push(string_tab[i]); stS.push(short_tab[i]); stL.push(long_tab[i]); } while (1) { loc(); } return 0; } #pragma GCC diagnostic pop // ----------------------------------------------------------------------------