doc: renamed project
This commit is contained in:
committed by
Sylvan Arnold
parent
244e516bd8
commit
32618389d1
33
pico-sensor/McuLib/rdimon/CMakeLists.txt
Normal file
33
pico-sensor/McuLib/rdimon/CMakeLists.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
# file: Collect all files that need to be compiled.
|
||||
# You can use a GLOB function as shown here, or explicitly mention the specific files
|
||||
#file(GLOB FILES *.c *.h)
|
||||
|
||||
set(THIS_LIBRARY_NAME rdimonLib)
|
||||
|
||||
file(GLOB FILES
|
||||
*.c
|
||||
)
|
||||
|
||||
# add_library: With this declaration, you express the intent to build a library.
|
||||
# The first argument is the name of the library,
|
||||
# the second argument are the files that will be compiled to create your library.
|
||||
add_library(${THIS_LIBRARY_NAME} ${FILES})
|
||||
|
||||
# target_link_libraries: If you link with other libraries, list them here
|
||||
target_link_libraries(
|
||||
${THIS_LIBRARY_NAME}
|
||||
PUBLIC McuLib
|
||||
)
|
||||
|
||||
target_compile_definitions(${THIS_LIBRARY_NAME} PUBLIC
|
||||
PICO_CMSIS_RENAME_EXCEPTIONS=0 # RP2040: do not use CMSIS vector names: causing issues/bug with linking libraries
|
||||
)
|
||||
|
||||
# target_include_directories: Libraries need to publish their header files
|
||||
# so that you can import them in source code. This statement expresses where to find the files
|
||||
# - typically in an include directory of your projects.
|
||||
target_include_directories(
|
||||
${THIS_LIBRARY_NAME}
|
||||
PUBLIC
|
||||
.
|
||||
)
|
||||
485
pico-sensor/McuLib/rdimon/COPYING.LIBGLOSS
Normal file
485
pico-sensor/McuLib/rdimon/COPYING.LIBGLOSS
Normal file
@@ -0,0 +1,485 @@
|
||||
The libgloss subdirectory is a collection of software from several sources.
|
||||
|
||||
Each file may have its own copyright/license that is embedded in the source
|
||||
file. Unless otherwise noted in the body of the source file(s), the following copyright
|
||||
notices will apply to the contents of the libgloss subdirectory:
|
||||
|
||||
(1) Red Hat Incorporated
|
||||
|
||||
Copyright (c) 1994-2009 Red Hat, Inc. All rights reserved.
|
||||
|
||||
This copyrighted material is made available to anyone wishing to use, modify,
|
||||
copy, or redistribute it subject to the terms and conditions of the BSD
|
||||
License. This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties
|
||||
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license
|
||||
is available at http://www.opensource.org/licenses. Any Red Hat trademarks that
|
||||
are incorporated in the source code or documentation are not subject to the BSD
|
||||
License and may only be used or replicated with the express permission of
|
||||
Red Hat, Inc.
|
||||
|
||||
(2) University of California, Berkeley
|
||||
|
||||
Copyright (c) 1981-2000 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
|
||||
(3) DJ Delorie
|
||||
|
||||
Copyright (C) 1993 DJ Delorie
|
||||
All rights reserved.
|
||||
|
||||
Redistribution, modification, and use in source and binary forms is permitted
|
||||
provided that the above copyright notice and following paragraph are
|
||||
duplicated in all such forms.
|
||||
|
||||
This file is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
(4) (formerly GPL for fr30)
|
||||
|
||||
The GPL is no longer applicable to the fr30 platform. The piece of
|
||||
code (syscalls.c) referencing the GPL has been officially relicensed.
|
||||
|
||||
(5) Advanced Micro Devices
|
||||
|
||||
Copyright 1989, 1990 Advanced Micro Devices, Inc.
|
||||
|
||||
This software is the property of Advanced Micro Devices, Inc (AMD) which
|
||||
specifically grants the user the right to modify, use and distribute this
|
||||
software provided this notice is not removed or altered. All other rights
|
||||
are reserved by AMD.
|
||||
|
||||
AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
|
||||
SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
|
||||
DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
|
||||
USE OF THIS SOFTWARE.
|
||||
|
||||
So that all may benefit from your experience, please report any problems
|
||||
or suggestions about this software to the 29K Technical Support Center at
|
||||
800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
|
||||
0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
|
||||
|
||||
Advanced Micro Devices, Inc.
|
||||
29K Support Products
|
||||
Mail Stop 573
|
||||
5900 E. Ben White Blvd.
|
||||
Austin, TX 78741
|
||||
800-292-9263
|
||||
|
||||
(6) - Analog Devices, Inc. (bfin-* targets)
|
||||
|
||||
Copyright (C) 2006, 2008, 2009, 2011, 2012 Analog Devices, Inc.
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
(7) University of Utah and the Computer Systems Laboratory (CSL)
|
||||
[applies only to hppa*-*-pro* targets]
|
||||
Copyright (c) 1990,1994 The University of Utah and
|
||||
the Computer Systems Laboratory (CSL). All rights reserved.
|
||||
|
||||
Permission to use, copy, modify and distribute this software is hereby
|
||||
granted provided that (1) source code retains these copyright, permission,
|
||||
and disclaimer notices, and (2) redistributions including binaries
|
||||
reproduce the notices in supporting documentation, and (3) all advertising
|
||||
materials mentioning features or use of this software display the following
|
||||
acknowledgement: ``This product includes software developed by the
|
||||
Computer Systems Laboratory at the University of Utah.''
|
||||
|
||||
THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
|
||||
IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
|
||||
ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
|
||||
CSL requests users of this software to return to csl-dist@cs.utah.edu any
|
||||
improvements that they make and grant CSL redistribution rights.
|
||||
|
||||
(8) Sun Microsystems
|
||||
|
||||
Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
||||
|
||||
Developed at SunPro, a Sun Microsystems, Inc. business.
|
||||
Permission to use, copy, modify, and distribute this
|
||||
software is freely granted, provided that this notice is preserved.
|
||||
|
||||
(9) Hewlett Packard
|
||||
|
||||
(c) Copyright 1986 HEWLETT-PACKARD COMPANY
|
||||
|
||||
To anyone who acknowledges that this file is provided "AS IS"
|
||||
without any express or implied warranty:
|
||||
|
||||
permission to use, copy, modify, and distribute this file
|
||||
for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice and this notice appears in all
|
||||
copies, and that the name of Hewlett-Packard Company not be
|
||||
used in advertising or publicity pertaining to distribution
|
||||
of the software without specific, written prior permission.
|
||||
Hewlett-Packard Company makes no representations about the
|
||||
suitability of this software for any purpose.
|
||||
|
||||
(10) Hans-Peter Nilsson
|
||||
|
||||
Copyright (C) 2001 Hans-Peter Nilsson
|
||||
|
||||
Permission to use, copy, modify, and distribute this software is
|
||||
freely granted, provided that the above copyright notice, this notice
|
||||
and the following disclaimer are preserved with no changes.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE.
|
||||
|
||||
(11) IBM Corp. spu processor (only spu-* targets)
|
||||
|
||||
(C) Copyright IBM Corp. 2005, 2006
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of IBM nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(12) Jon Beniston (only lm32-* targets)
|
||||
|
||||
Contributed by Jon Beniston <jon@beniston.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
(13) - Xilinx, Inc. (microblaze-* and powerpc-* targets)
|
||||
|
||||
Copyright (c) 2004, 2009 Xilinx, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of Xilinx nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
(14) - National Semiconductor Corporation
|
||||
|
||||
Copyright (c) 2004 National Semiconductor Corporation
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
|
||||
(15) - CodeSourcery, Inc. (tic6x-* targets)
|
||||
|
||||
Copyright (c) 2010 CodeSourcery, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of CodeSourcery nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY CODESOURCERY, INC. ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL CODESOURCERY BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
(16) - GPL with exception (sparc-*leon*, crx-*, cr16-* targets only)
|
||||
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
Written By David Vinayak Henkel-Wallace, June 1992
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
In addition to the permissions in the GNU General Public License, the
|
||||
Free Software Foundation gives you unlimited permission to link the
|
||||
compiled version of this file with other programs, and to distribute
|
||||
those programs without any restriction coming from the use of this
|
||||
file. (The General Public License restrictions do apply in other
|
||||
respects; for example, they cover modification of the file, and
|
||||
distribution when not linked into another program.)
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License.
|
||||
|
||||
|
||||
(17) - Adapteva, Inc. (epiphany-* targets)
|
||||
|
||||
Copyright (c) 2011, Adapteva, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of Adapteva nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
(18) - Rolls-Royce Controls and Data Services Limited (visium-* targets)
|
||||
|
||||
Copyright (c) 2015 Rolls-Royce Controls and Data Services Limited.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Rolls-Royce Controls and Data Services Limited nor
|
||||
the names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(19) - FTDI (ft32-* targets)
|
||||
|
||||
Copyright (C) 2014 FTDI (support@ftdichip.com)
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
(20) - Synopsys Inc (arc-* targets)
|
||||
|
||||
Copyright (c) 2015, Synopsys, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1) Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2) Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3) Neither the name of the Synopsys, Inc., nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(21) BSD-2-Clause-FreeBSD (pru-* targets)
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
|
||||
Copyright (c) 2018-2019 Dimitar Dimitrov <dimitar@dinux.eu>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(22) CodeSourcery, Inc (csky-* targets)
|
||||
|
||||
Copyright (c) 2006 CodeSourcery Inc
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
(23) - C-SKY Microsystems (csky-* targets)
|
||||
|
||||
Copyright (c) 2020 C-SKY Microsystems All rights reserved.
|
||||
|
||||
This copyrighted material is made available to anyone wishing to use,
|
||||
modify, copy, or redistribute it subject to the terms and conditions
|
||||
of the FreeBSD License. This program is distributed in the hope that
|
||||
it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
|
||||
including the implied warranties of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. A copy of this license is available at
|
||||
http://www.opensource.org/licenses.
|
||||
|
||||
(24) - RISC-V Semihosting (riscv-* targets)
|
||||
|
||||
Copyright (C) 2020 Embecosm Limited
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
439
pico-sensor/McuLib/rdimon/McuRdimon.c
Normal file
439
pico-sensor/McuLib/rdimon/McuRdimon.c
Normal file
@@ -0,0 +1,439 @@
|
||||
/*!
|
||||
** \file McuRdimon.c
|
||||
** \brief Implementation of the Remote Debugger Interface.
|
||||
*/
|
||||
|
||||
/* Support files for GNU libc.
|
||||
Implementation has been used from
|
||||
gcc-arm-none-eabi-10.3-2021.10-src\gcc-arm-none-eabi-10.3-2021.10\src\newlib\libgloss\arm\syscalls.c
|
||||
and adapted and simplifying using the McuSemihost library.
|
||||
*/
|
||||
|
||||
#include "McuRdimon.h"
|
||||
|
||||
#if McuRdimon_CONFIG_IS_ENABLED
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/times.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "McuSemihost.h"
|
||||
|
||||
int _stat (const char *, struct stat *);
|
||||
|
||||
/* Struct used to keep track of the file position, just so we
|
||||
can implement fseek(fh,x,SEEK_CUR). */
|
||||
struct fdent {
|
||||
int handle; /* file handle */
|
||||
int pos; /* position in file */
|
||||
};
|
||||
|
||||
#define MAX_OPEN_FILES 20
|
||||
|
||||
/* User file descriptors (fd) are integer indexes into
|
||||
the openfiles[] array. Error checking is done by using
|
||||
findslot().
|
||||
|
||||
This openfiles array is manipulated directly by only
|
||||
these 5 functions:
|
||||
|
||||
findslot() - Translate entry.
|
||||
newslot() - Find empty entry.
|
||||
initialise_monitor_handles() - Initialize entries.
|
||||
_swiopen() - Initialize entry.
|
||||
_close() - Handle stdout == stderr case.
|
||||
|
||||
Every other function must use findslot(). */
|
||||
|
||||
static struct fdent openfiles [MAX_OPEN_FILES];
|
||||
|
||||
static int monitor_stdin;
|
||||
static int monitor_stdout;
|
||||
static int monitor_stderr;
|
||||
|
||||
/* Return a pointer to the structure associated with
|
||||
the user file descriptor fd. */
|
||||
static struct fdent*findslot (int fd) {
|
||||
/* User file descriptor is out of range. */
|
||||
if ((unsigned int)fd >= MAX_OPEN_FILES) {
|
||||
return NULL;
|
||||
}
|
||||
/* User file descriptor is open? */
|
||||
if (openfiles[fd].handle == -1) {
|
||||
return NULL;
|
||||
}
|
||||
/* Valid. */
|
||||
return &openfiles[fd];
|
||||
}
|
||||
|
||||
/* Return the next lowest numbered free file
|
||||
structure, or -1 if we can't find one. */
|
||||
static int newslot (void) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_OPEN_FILES; i++) {
|
||||
if (openfiles[i].handle == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == MAX_OPEN_FILES) {
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
static int get_errno (void) {
|
||||
return McuSemihost_SysErrNo();
|
||||
}
|
||||
|
||||
/* Set errno and return result. */
|
||||
static int error (int result) {
|
||||
errno = get_errno ();
|
||||
return result;
|
||||
}
|
||||
|
||||
/* fh, is a valid internal file handle.
|
||||
ptr, is a null terminated string.
|
||||
len, is the length in bytes to read.
|
||||
Returns the number of bytes *not* written. */
|
||||
int _swiread (int fh, void * ptr, size_t len) {
|
||||
return McuSemihost_SysFileRead(fh, ptr, len);
|
||||
}
|
||||
|
||||
/* fd, is a valid user file handle.
|
||||
Translates the return of _swiread into
|
||||
bytes read. */
|
||||
int __attribute__((weak)) _read (int fd, void * ptr, size_t len) {
|
||||
int res;
|
||||
struct fdent *pfd;
|
||||
|
||||
pfd = findslot (fd);
|
||||
if (pfd == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
res = _swiread (pfd->handle, ptr, len);
|
||||
if (res == -1) {
|
||||
return res;
|
||||
}
|
||||
pfd->pos += len - res;
|
||||
/* res == len is not an error,
|
||||
at least if we want feof() to work. */
|
||||
return len - res;
|
||||
}
|
||||
|
||||
/* fd, is a user file descriptor. */
|
||||
off_t _swilseek (int fd, off_t ptr, int dir) {
|
||||
off_t res;
|
||||
struct fdent *pfd;
|
||||
|
||||
/* Valid file descriptor? */
|
||||
pfd = findslot (fd);
|
||||
if (pfd == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
/* Valid whence? */
|
||||
if ((dir != SEEK_CUR)
|
||||
&& (dir != SEEK_SET)
|
||||
&& (dir != SEEK_END))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
/* Convert SEEK_CUR to SEEK_SET */
|
||||
if (dir == SEEK_CUR) {
|
||||
ptr = pfd->pos + ptr;
|
||||
/* The resulting file offset would be negative. */
|
||||
if (ptr < 0) {
|
||||
errno = EINVAL;
|
||||
if ((pfd->pos > 0) && (ptr > 0)) {
|
||||
errno = EOVERFLOW;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
dir = SEEK_SET;
|
||||
}
|
||||
if (dir == SEEK_END) {
|
||||
res = McuSemihost_SysFileLen(pfd->handle);
|
||||
if (res == -1) {
|
||||
return -1;
|
||||
}
|
||||
ptr += res;
|
||||
}
|
||||
/* This code only does absolute seeks. */
|
||||
res = McuSemihost_SysFileSeek(pfd->handle, (int)ptr);
|
||||
/* At this point ptr is the current file position. */
|
||||
if (res >= 0) {
|
||||
pfd->pos = ptr;
|
||||
return ptr;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
off_t _lseek (int fd, off_t ptr, int dir) {
|
||||
return _swilseek (fd, ptr, dir);
|
||||
}
|
||||
|
||||
/* fh, is a valid internal file handle.
|
||||
Returns the number of bytes *not* written. */
|
||||
int _swiwrite (int fh, const void * ptr, size_t len) {
|
||||
return McuSemihost_SysFileWrite(fh, ptr, len);
|
||||
}
|
||||
|
||||
/* fd, is a user file descriptor. */
|
||||
int __attribute__((weak)) _write (int fd, const void * ptr, size_t len) {
|
||||
int res;
|
||||
struct fdent *pfd;
|
||||
|
||||
pfd = findslot (fd);
|
||||
if (pfd == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
res = _swiwrite (pfd->handle, ptr,len);
|
||||
/* Clearly an error. */
|
||||
if (res < 0) {
|
||||
return -1;
|
||||
}
|
||||
pfd->pos += len - res;
|
||||
/* We wrote 0 bytes?
|
||||
Retrieve errno just in case. */
|
||||
if ((len - res) == 0) {
|
||||
return error (0);
|
||||
}
|
||||
return (len - res);
|
||||
}
|
||||
|
||||
int _swiopen (const char *path, int flags) {
|
||||
int aflags = 0, fh;
|
||||
|
||||
int fd = newslot ();
|
||||
if (fd == -1) {
|
||||
errno = EMFILE;
|
||||
return -1;
|
||||
}
|
||||
/* It is an error to open a file that already exists. */
|
||||
if ((flags & O_CREAT) && (flags & O_EXCL)) {
|
||||
struct stat st;
|
||||
int res;
|
||||
res = _stat(path, &st);
|
||||
if (res != -1) {
|
||||
errno = EEXIST;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/* The flags are Unix-style, so we need to convert them. */
|
||||
#ifdef O_BINARY
|
||||
if (flags & O_BINARY)
|
||||
aflags |= SYS_FILE_MODE_READBINARY;
|
||||
#endif
|
||||
/* In O_RDONLY we expect aflags == 0. */
|
||||
if (flags & O_RDWR) {
|
||||
aflags |= SYS_FILE_MODE_READWRITE;
|
||||
}
|
||||
if ((flags & O_CREAT)
|
||||
|| (flags & O_TRUNC)
|
||||
|| (flags & O_WRONLY))
|
||||
{
|
||||
aflags |= SYS_FILE_MODE_WRITE;
|
||||
}
|
||||
if (flags & O_APPEND) {
|
||||
aflags &= ~SYS_FILE_MODE_WRITE; /* Can't ask for w AND a; means just 'a'. */
|
||||
aflags |= SYS_FILE_MODE_APPEND;
|
||||
}
|
||||
fh = McuSemihost_SysFileOpen((const unsigned char*)path, aflags);
|
||||
/* Return a user file descriptor or an error. */
|
||||
if (fh >= 0) {
|
||||
openfiles[fd].handle = fh;
|
||||
openfiles[fd].pos = 0;
|
||||
return fd;
|
||||
} else {
|
||||
return error (fh);
|
||||
}
|
||||
}
|
||||
|
||||
int _open (const char * path, int flags, ...) {
|
||||
return _swiopen (path, flags);
|
||||
}
|
||||
|
||||
int _close (int fd) {
|
||||
int res;
|
||||
struct fdent *pfd;
|
||||
|
||||
pfd = findslot (fd);
|
||||
if (pfd == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
/* Handle stderr == stdout. */
|
||||
if ((fd == 1 || fd == 2)
|
||||
&& (openfiles[1].handle == openfiles[2].handle))
|
||||
{
|
||||
pfd->handle = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Attempt to close the handle. */
|
||||
res = McuSemihost_SysFileClose(pfd->handle);
|
||||
/* Reclaim handle? */
|
||||
if (res == 0) {
|
||||
pfd->handle = -1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int _swistat (int fd, struct stat * st) {
|
||||
struct fdent *pfd;
|
||||
int res;
|
||||
|
||||
pfd = findslot (fd);
|
||||
if (pfd == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
/* Always assume a character device,
|
||||
with 1024 byte blocks. */
|
||||
st->st_mode |= S_IFCHR;
|
||||
st->st_blksize = 1024;
|
||||
res = McuSemihost_SysFileLen(pfd->handle);
|
||||
if (res == -1) {
|
||||
return -1;
|
||||
}
|
||||
st->st_size = res; /* set the file size. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __attribute__((weak)) _fstat (int fd, struct stat * st) {
|
||||
memset (st, 0, sizeof (*st));
|
||||
return _swistat (fd, st);
|
||||
}
|
||||
|
||||
int __attribute__((weak)) _stat (const char *fname, struct stat *st) {
|
||||
int fd, res;
|
||||
memset (st, 0, sizeof (* st));
|
||||
/* The best we can do is try to open the file readonly. If it exists,
|
||||
then we can guess a few things about it. */
|
||||
if ((fd = _open (fname, O_RDONLY)) == -1) {
|
||||
return -1;
|
||||
}
|
||||
#ifndef S_IREAD /* define locally, e.g. because __BSD_VISIBLE might not be set to 1 */
|
||||
#define S_IREAD 0000400 /* read permission, owner */
|
||||
#endif
|
||||
st->st_mode |= S_IFREG | S_IREAD;
|
||||
res = _swistat (fd, st);
|
||||
/* Not interested in the error. */
|
||||
_close (fd);
|
||||
return res;
|
||||
}
|
||||
|
||||
int _unlink (const char *path) {
|
||||
#if McuSemihost_CONFIG_HAS_SYS_REMOVE
|
||||
int res;
|
||||
res = McuSemihost_SysFileRemove((const unsigned char*)path);
|
||||
if (res == -1) {
|
||||
return error (res);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int _gettimeofday (struct timeval * tp, void * tzvp) {
|
||||
struct timezone *tzp = tzvp;
|
||||
if (tp) {
|
||||
/* Ask the host for the seconds since the Unix epoch. */
|
||||
tp->tv_sec = McuSemihost_SysHostTime();
|
||||
tp->tv_usec = 0;
|
||||
}
|
||||
/* Return fixed data for the timezone. */
|
||||
if (tzp) {
|
||||
tzp->tz_minuteswest = 0;
|
||||
tzp->tz_dsttime = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return a clock that ticks at 100Hz. */
|
||||
clock_t _clock (void) {
|
||||
clock_t timeval;
|
||||
|
||||
timeval = McuSemihost_SysHostClock();
|
||||
return timeval;
|
||||
}
|
||||
|
||||
/* Return a clock that ticks at 100Hz. */
|
||||
clock_t _times (struct tms * tp) {
|
||||
clock_t timeval = _clock();
|
||||
if (tp) {
|
||||
tp->tms_utime = timeval; /* user time */
|
||||
tp->tms_stime = 0; /* system time */
|
||||
tp->tms_cutime = 0; /* user time, children */
|
||||
tp->tms_cstime = 0; /* system time, children */
|
||||
}
|
||||
return timeval;
|
||||
};
|
||||
|
||||
int _isatty (int fd) {
|
||||
struct fdent *pfd;
|
||||
int tty;
|
||||
|
||||
pfd = findslot (fd);
|
||||
if (pfd == NULL) {
|
||||
errno = EBADF;
|
||||
return 0;
|
||||
}
|
||||
tty = McuSemihost_SysIsTTY(pfd->handle);
|
||||
if (tty == 1) {
|
||||
return 1;
|
||||
}
|
||||
errno = get_errno();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _rename (const char *oldpath, const char *newpath) {
|
||||
#if McuSemihost_CONFIG_HAS_SYS_RENAME
|
||||
return McuSemihost_SysFileRename((const unsigned char*)oldpath, (const unsigned char*)newpath);
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void McuRdimon_Init(void) {
|
||||
/* Open the standard file descriptors by opening the special
|
||||
* teletype device, ":tt", read-only to obtain a descriptor for
|
||||
* standard input and write-only to obtain a descriptor for standard
|
||||
* output. Finally, open ":tt" in append mode to obtain a descriptor
|
||||
* for standard error. Since this is a write mode, most kernels will
|
||||
* probably return the same value as for standard output, but the
|
||||
* kernel can differentiate the two using the mode flag and return a
|
||||
* different descriptor for standard error.
|
||||
*/
|
||||
monitor_stdin = McuSemihost_SysFileOpen((unsigned char*)":tt", SYS_FILE_MODE_READ); /* stdin */
|
||||
monitor_stdout = McuSemihost_SysFileOpen((unsigned char*)":tt", SYS_FILE_MODE_WRITE); /* stdout */
|
||||
monitor_stderr = McuSemihost_SysFileOpen((unsigned char*)":tt", SYS_FILE_MODE_APPEND); /* stderr */
|
||||
for (int i = 0; i < MAX_OPEN_FILES; i ++) {
|
||||
openfiles[i].handle = -1;
|
||||
}
|
||||
|
||||
/* If we failed to open stderr, redirect to stdout. */
|
||||
if (monitor_stderr == -1) {
|
||||
monitor_stderr = monitor_stdout;
|
||||
}
|
||||
openfiles[0].handle = monitor_stdin;
|
||||
openfiles[0].pos = 0;
|
||||
openfiles[1].handle = monitor_stdout;
|
||||
openfiles[1].pos = 0;
|
||||
openfiles[2].handle = monitor_stderr;
|
||||
openfiles[2].pos = 0;
|
||||
}
|
||||
|
||||
#endif /* McuRdimon_CONFIG_IS_ENABLED */
|
||||
23
pico-sensor/McuLib/rdimon/McuRdimon.h
Normal file
23
pico-sensor/McuLib/rdimon/McuRdimon.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*!
|
||||
** \file McuRdimon.h
|
||||
** \brief Interface for Remote Debugger Interface.
|
||||
*/
|
||||
|
||||
#ifndef MCURDIMON_H
|
||||
#define MCURDIMON_H
|
||||
|
||||
#include "McuRdimon_config.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* initializes standard I/O handles */
|
||||
void McuRdimon_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* MCURDIMON_H */
|
||||
17
pico-sensor/McuLib/rdimon/McuRdimon_config.h
Normal file
17
pico-sensor/McuLib/rdimon/McuRdimon_config.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*!
|
||||
* Copyright (c) 2023, Erich Styger
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* \file
|
||||
* \brief Configuration items for the Remote Debugger Interface.
|
||||
*/
|
||||
|
||||
#ifndef RDIMON_MCURDIMON_CONFIG_H_
|
||||
#define RDIMON_MCURDIMON_CONFIG_H_
|
||||
|
||||
#ifndef McuRdimon_CONFIG_IS_ENABLED
|
||||
#define McuRdimon_CONFIG_IS_ENABLED (0)
|
||||
/*!< 1: module is enabled; 0: module is disabled */
|
||||
#endif
|
||||
|
||||
#endif /* RDIMON_MCURDIMON_CONFIG_H_ */
|
||||
6
pico-sensor/McuLib/rdimon/readme.txt
Normal file
6
pico-sensor/McuLib/rdimon/readme.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
This directory implements a 'remote dispatch interface monitor' using semihosting.
|
||||
|
||||
The implementatation is based from the 'arm/syscall.c' implementation, see
|
||||
gcc-arm-none-eabi-10.3-2021.10-src\gcc-arm-none-eabi-10.3-2021.10\src\newlib\libgloss\arm\syscalls.c
|
||||
|
||||
For licensing, see the COPYING.LIBGLOSS information in this folder.
|
||||
Reference in New Issue
Block a user