From 9ce6a6466a178d50bc4df2e32dfc2c5b862348d3 Mon Sep 17 00:00:00 2001
From: Federico Terraneo <fede.tft@miosix.org>
Date: Sun, 14 May 2017 11:44:46 +0200
Subject: [PATCH] Fixed copyright notice of a file taken from
 miosix/arch/common/drivers, added static to prevent some variables from being
 global

---
 src/shared/i2c/stm32f2_f4_i2c.cpp | 53 +++++++++++++++++--------------
 src/shared/i2c/stm32f2_f4_i2c.h   | 47 +++++++++++++++------------
 2 files changed, 55 insertions(+), 45 deletions(-)

diff --git a/src/shared/i2c/stm32f2_f4_i2c.cpp b/src/shared/i2c/stm32f2_f4_i2c.cpp
index 4c089b4ef..1382a3708 100644
--- a/src/shared/i2c/stm32f2_f4_i2c.cpp
+++ b/src/shared/i2c/stm32f2_f4_i2c.cpp
@@ -1,24 +1,29 @@
-/* Copyright (c) 2015-2016 Skyward Experimental Rocketry
- * Authors: Silvano Seva
- *
- * 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.
- */
+/***************************************************************************
+ *   Copyright (C) 2013 by Terraneo Federico and Silvano Seva              *
+ *                                                                         *
+ *   This program 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 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program 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.                          *
+ *                                                                         *
+ *   As a special exception, if other files instantiate templates or use   *
+ *   macros or inline functions from this file, or you compile this file   *
+ *   and link it with other works to produce a work based on this file,    *
+ *   this file does not by itself cause the resulting work to be covered   *
+ *   by the GNU General Public License. However the source code for this   *
+ *   file must still be made available in accordance with the GNU General  *
+ *   Public License. This exception does not invalidate any other reasons  *
+ *   why a work based on this file might be covered by the GNU General     *
+ *   Public License.                                                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
+ ***************************************************************************/
 
 #include "stm32f2_f4_i2c.h"
 #include <miosix.h>
@@ -38,9 +43,9 @@ static Thread *waiting=0; ///< Thread waiting for an operation to complete
  */
 
 #ifndef I2C_WITH_DMA
-uint8_t *rxBuf = 0;
-unsigned int rxBufCnt = 0;
-unsigned int rxBufSize = 0;
+static uint8_t *rxBuf = 0;
+static unsigned int rxBufCnt = 0;
+static unsigned int rxBufSize = 0;
 #endif
 
 
diff --git a/src/shared/i2c/stm32f2_f4_i2c.h b/src/shared/i2c/stm32f2_f4_i2c.h
index a03091b28..6359ba0c4 100644
--- a/src/shared/i2c/stm32f2_f4_i2c.h
+++ b/src/shared/i2c/stm32f2_f4_i2c.h
@@ -1,24 +1,29 @@
-/* Copyright (c) 2015-2016 Skyward Experimental Rocketry
- * Authors: Silvano Seva
- *
- * 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.
- */
+/***************************************************************************
+ *   Copyright (C) 2013 by Terraneo Federico and Silvano Seva              *
+ *                                                                         *
+ *   This program 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 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program 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.                          *
+ *                                                                         *
+ *   As a special exception, if other files instantiate templates or use   *
+ *   macros or inline functions from this file, or you compile this file   *
+ *   and link it with other works to produce a work based on this file,    *
+ *   this file does not by itself cause the resulting work to be covered   *
+ *   by the GNU General Public License. However the source code for this   *
+ *   file must still be made available in accordance with the GNU General  *
+ *   Public License. This exception does not invalidate any other reasons  *
+ *   why a work based on this file might be covered by the GNU General     *
+ *   Public License.                                                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
+ ***************************************************************************/ 
 
 #ifndef STM32F2_I2C_H
 #define STM32F2_I2C_H
-- 
GitLab