From fd55dc36ac57086424729716c4032641364623ae Mon Sep 17 00:00:00 2001
From: Rahix <rahix@rahix.de>
Date: Thu, 21 May 2020 17:04:03 +0200
Subject: [PATCH] chore: Remove trailing whitespaces

It's 44 years since the release of vi and sadly lots of editors still
don't care about trimming off trailing spaces ...

Signed-off-by: Rahix <rahix@rahix.de>
---
 Documentation/bluetooth/card10.rst |  4 ++--
 Documentation/debugger.rst         |  4 ++--
 Documentation/how-to-build.rst     | 12 +++++-----
 epicardium/ble/app/common/app_ui.c |  2 +-
 epicardium/ble/ble_main.c          |  2 +-
 epicardium/ble/card10.c            |  4 ++--
 epicardium/ble/filetransfer.c      | 16 ++++++-------
 epicardium/ble/stack.c             |  2 +-
 epicardium/epicardium.h            |  6 ++---
 epicardium/fs/internal.h           |  2 +-
 epicardium/modules/filesystem.h    |  6 ++---
 epicardium/modules/usb.c           |  8 +++----
 epicardium/usb/cdcacm.c            |  2 +-
 epicardium/usb/epc_usb.c           | 36 +++++++++++++++---------------
 epicardium/usb/epc_usb.h           |  2 +-
 pycardium/modules/py/pov.py        |  6 ++---
 pycardium/modules/py/pride.py      | 10 ++++-----
 17 files changed, 62 insertions(+), 62 deletions(-)

diff --git a/Documentation/bluetooth/card10.rst b/Documentation/bluetooth/card10.rst
index 2991fa2ff..2530d00da 100644
--- a/Documentation/bluetooth/card10.rst
+++ b/Documentation/bluetooth/card10.rst
@@ -196,7 +196,7 @@ Accessing services from a linux system is possible via ``btgatt-client``. The in
 .. code-block::
 
     # pairing the card10:
-    
+
     $ bluetoothctl
     [bluetooth]# power on
     [bluetooth]# scan on
@@ -213,7 +213,7 @@ Accessing services from a linux system is possible via ``btgatt-client``. The in
 
     # if this error appears remove and re-pair:
     [GATT client]# Device disconnected: Software caused connection abort
-    
+
 
 ARM Cordio Sources
 ------------------
diff --git a/Documentation/debugger.rst b/Documentation/debugger.rst
index 4c34ca029..b28bb9e52 100644
--- a/Documentation/debugger.rst
+++ b/Documentation/debugger.rst
@@ -56,7 +56,7 @@ the following commands:
 .. warning::
     Make sure ``CMSIS-DAP Compliant Debugger`` is set to **yes (auto)** after
     running ``./configure`` (if it is not, you might need to install ``libhidapi-dev``
-    (Ubuntu)). If you get errors making the documentation you can 
+    (Ubuntu)). If you get errors making the documentation you can
     ``touch doc/openocd.info`` to skip it and continue with ``make``.
 
 .. code-block:: shell-session
@@ -118,7 +118,7 @@ command to soft-reset card10.
 .. note::
    You will also find the following self-describing gdb files in the firmware
    root directory, which do not require additional arguments:
-   ``flash-all.gdb,  flash-bootloader.gdb,  
+   ``flash-all.gdb,  flash-bootloader.gdb,
    flash-both.gdb,  flash-epicardium.gdb,  flash-pycardium.gdb``
 
 .. warning::
diff --git a/Documentation/how-to-build.rst b/Documentation/how-to-build.rst
index b152bf75f..041337a2d 100644
--- a/Documentation/how-to-build.rst
+++ b/Documentation/how-to-build.rst
@@ -29,7 +29,7 @@ Dependencies
 
         dnf install arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib
 
-  - macOS (Note: The card10 firmware team used Linux so far. macOS recommendations here are experimental.) 
+  - macOS (Note: The card10 firmware team used Linux so far. macOS recommendations here are experimental.)
 
     You can use `Homebrew`_ to install the required tools.  The version of the
     ARM crosscompiler tool chain is quite important; with the wrong version,
@@ -176,12 +176,12 @@ Otherwise, rerunning ``./bootstrap.sh`` will also clean the build-directory.
 
 .. note::
 
-   If you try to flash pycardium_epicardium.bin (renamed to card10.bin) 
+   If you try to flash pycardium_epicardium.bin (renamed to card10.bin)
    and the bootloader does not finish updating, the file might be too large.
-   ~700kB is the normal size, but problems were reported where the file size 
-   was >1MB. This was caused by the ``tr`` tool in the build process 
-   (it's supposed to create a large file with 0xff in it) - this requires the 
-   LC_ALL environment variable to be not set, or set to "C" 
+   ~700kB is the normal size, but problems were reported where the file size
+   was >1MB. This was caused by the ``tr`` tool in the build process
+   (it's supposed to create a large file with 0xff in it) - this requires the
+   LC_ALL environment variable to be not set, or set to "C"
    (but not UTF8 or similar).
 
 Docker
diff --git a/epicardium/ble/app/common/app_ui.c b/epicardium/ble/app/common/app_ui.c
index 0c7277ca1..f5c6f568a 100644
--- a/epicardium/ble/app/common/app_ui.c
+++ b/epicardium/ble/app/common/app_ui.c
@@ -40,7 +40,7 @@ appUiCback_t appUiCbackTbl;
 
 /*************************************************************************************************/
 /*!
- *  \brief  card10 - Should disable encryption. MAXIM bug reported to us in current static library. Requires 
+ *  \brief  card10 - Should disable encryption. MAXIM bug reported to us in current static library. Requires
  *                   this to be called before the BTLE app starts making advertisements. Avoids encryption
  *                   rendering the frame unreadable.
  *
diff --git a/epicardium/ble/ble_main.c b/epicardium/ble/ble_main.c
index b1ed22764..dfbc96339 100644
--- a/epicardium/ble/ble_main.c
+++ b/epicardium/ble/ble_main.c
@@ -339,7 +339,7 @@ static void bleSetup(bleMsg_t *pMsg)
       bleScanDataDisc[14] = f;
     }
   }
-  
+
   /* set advertising and scan response data for discoverable mode */
   AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(bleAdvDataDisc), (uint8_t *) bleAdvDataDisc);
   AppAdvSetData(APP_SCAN_DATA_DISCOVERABLE, sizeof(bleScanDataDisc), (uint8_t *) bleScanDataDisc);
diff --git a/epicardium/ble/card10.c b/epicardium/ble/card10.c
index 7f896bfe4..c7fa728a4 100644
--- a/epicardium/ble/card10.c
+++ b/epicardium/ble/card10.c
@@ -235,7 +235,7 @@ static const uint8_t UUID_attChar_personal_state[] = {
 	CARD10_UUID_SUFFIX, 0x19, CARD10_UUID_PREFIX
 };
 
-static uint8_t personalStateValue = 0; 
+static uint8_t personalStateValue = 0;
 static uint16_t personalStateLen = sizeof(personalStateValue);
 
 /* BLE UUID for card10 above leds */
@@ -280,7 +280,7 @@ static uint16_t initLightSensorLen = sizeof(initLightSensorValue);
 /* clang-format on */
 
 /*
- * Create the BLE service description. 
+ * Create the BLE service description.
  */
 
 static const attsAttr_t card10SvcAttrList[] = {
diff --git a/epicardium/ble/filetransfer.c b/epicardium/ble/filetransfer.c
index df888a744..e3897c449 100644
--- a/epicardium/ble/filetransfer.c
+++ b/epicardium/ble/filetransfer.c
@@ -1,9 +1,9 @@
 /*
  * BLE (Bluetooth Low energy) file transfer service.
  *
- * This file provides a BLE service and a characteristic which allows to 
- * write the content of the mytest.py file over BLE into the file system. 
- * We haven't found any existing BLE service which provides such a 
+ * This file provides a BLE service and a characteristic which allows to
+ * write the content of the mytest.py file over BLE into the file system.
+ * We haven't found any existing BLE service which provides such a
  * functionality so we implemented our own service.
 
  * The service uses the UUID in fileTransSvc
@@ -11,11 +11,11 @@
 
  * BLE point to point links use a pretty small MTU (min 23 bytes, max 244
  * bytes) which is negotiated between the central and the peripheral (card10).
- * 
+ *
  * The first byte of each message is the type of message being send,
  * different types are supported and based on this type the next bytes
  * have different meaning.
- * 
+ *
  * TODOs:
  * * File deletion
  * * File read
@@ -180,7 +180,7 @@ static const attsAttr_t fileTransCfgList[] = {
 
 /**
  * Send a repose with an optional CRC.
- * 
+ *
  * The Central RX characteristic is filled and a notification is send in addition.
  * If msg is given message is added in addition.
  */
@@ -222,7 +222,7 @@ static void sendCrcResponse(
 }
 
 /*
- * This function splits the path into the folders and the file name and 
+ * This function splits the path into the folders and the file name and
  * creates all the missing folders.
  */
 static int bleFileCreateOrOpen(char *filepath)
@@ -377,7 +377,7 @@ static uint8_t handleCentralTX(
 
 /*
  * BLE file transfer write callback.
- * 
+ *
  * This gets called when data is written by a BLE central to our BLE
  * peripheral. Here we take care of handling the received data.
  */
diff --git a/epicardium/ble/stack.c b/epicardium/ble/stack.c
index c06c7bc5a..79ccce44b 100644
--- a/epicardium/ble/stack.c
+++ b/epicardium/ble/stack.c
@@ -137,7 +137,7 @@ void StackInit(void)
 #endif /* DATS_APP_USE_LEGACY_API */
   if(memUsed != LL_MEMORY_FOOTPRINT)
   {
-      printf("Controller memory mismatch 0x%x != 0x%x\n", (unsigned int)memUsed, 
+      printf("Controller memory mismatch 0x%x != 0x%x\n", (unsigned int)memUsed,
           (unsigned int)LL_MEMORY_FOOTPRINT);
   }
 #endif
diff --git a/epicardium/epicardium.h b/epicardium/epicardium.h
index f23987329..f61705431 100644
--- a/epicardium/epicardium.h
+++ b/epicardium/epicardium.h
@@ -914,9 +914,9 @@ struct max86150_sensor_data {
 
 /**
  * Enable a MAX86150 PPG and ECG sensor.
- * 
- * Calling this function will instruct the MAX86150 to collect a 
- * data from the sensor.  You can then retrieve the samples using 
+ *
+ * Calling this function will instruct the MAX86150 to collect a
+ * data from the sensor.  You can then retrieve the samples using
  * :c:func:`epic_stream_read`.
  *
  * :param max86150_sensor_config* config: Configuration for this sensor.
diff --git a/epicardium/fs/internal.h b/epicardium/fs/internal.h
index 8d0fe2536..a0cf2a0c8 100644
--- a/epicardium/fs/internal.h
+++ b/epicardium/fs/internal.h
@@ -33,7 +33,7 @@ int efs_rename(EpicFileSystem *fs, const char *oldp, const char *newp);
 int efs_mkdir(EpicFileSystem *fs, const char *dirname);
 /**
  * lock global filesystem
- * 
+ *
  * locks the global mutex and, if the global EpicFileSystem has been initialized correctly
  * passes it to *fs
  *
diff --git a/epicardium/modules/filesystem.h b/epicardium/modules/filesystem.h
index db54a2895..2b89398be 100644
--- a/epicardium/modules/filesystem.h
+++ b/epicardium/modules/filesystem.h
@@ -16,7 +16,7 @@ void fatfs_init(void);
 
 /**
  * initialize and mount the FLASH storage
- * 
+ *
  * NOTE: not safe to be called from an ISR
  */
 int fatfs_attach(void);
@@ -24,7 +24,7 @@ int fatfs_attach(void);
 
 /**
  * asynchronously attach the FLASH storage
- * 
+ *
  * safe to be called from an ISR
  */
 void fatfs_schedule_attach(void);
@@ -32,7 +32,7 @@ void fatfs_schedule_attach(void);
 /** close all opened FDs, sync and deinitialize FLASH layer */
 void fatfs_detach(void);
 
-/** close all onpened FDs 
+/** close all onpened FDs
  * TODO: add ability to close FDs opened by core0/core1 only
  */
 #define EPICARDIUM_COREMASK_0		0x01
diff --git a/epicardium/modules/usb.c b/epicardium/modules/usb.c
index 512904255..1e23c99cf 100644
--- a/epicardium/modules/usb.c
+++ b/epicardium/modules/usb.c
@@ -1,12 +1,12 @@
 /**
- * 
+ *
  * Implementation of public epic_usb_ interface
- * 
+ *
  * Configuration and FLASH-specific implementation of USB mass storage device
  * Configuration of USB CDCACM device
- * 
+ *
  * USB descriptors for both are defined here.
- * 
+ *
  */
 
 #include "epicardium.h"
diff --git a/epicardium/usb/cdcacm.c b/epicardium/usb/cdcacm.c
index a3e9f33db..d90951626 100644
--- a/epicardium/usb/cdcacm.c
+++ b/epicardium/usb/cdcacm.c
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  * epicardium-specific implemnetation of cdcacm device
  * services CDCACM API
  */
diff --git a/epicardium/usb/epc_usb.c b/epicardium/usb/epc_usb.c
index b99c34a07..e95024365 100644
--- a/epicardium/usb/epc_usb.c
+++ b/epicardium/usb/epc_usb.c
@@ -1,50 +1,50 @@
 /**
- * 
- * 
+ *
+ *
  * Core of the USB implementation:
- * 
+ *
  * - device independent
  * - handles setup of MAXUSB stack
  * - handles events and state of the MAXUSB stack
- * 
+ *
  * Also contains definitions of device-independent String descriptors
- * 
- * 
- * 
- * 
- * 
+ *
+ *
+ *
+ *
+ *
  * swym's USB ramblings:
- * 
+ *
  * setting up USB basically consists of two parts:
- * 
+ *
  * - set up descriptors
  * - initialize the corresponding MAXUSB stacks - acm, msc...
- * 
+ *
  * at the moment, the descriptors are statically configured in
  * descriptors.h several descriptors point to enumeration descriptors
  * via iFooBar indices. Those enumeration descriptors are registered
  * via enum_register_descriptor(type, desc, idx), where the idx passed
  * corresponds to the iFooBar index mentioned above.
- * 
+ *
  * There are several callbacks, some of which do not perform anything meaningful
  * at the moment. For example usb_write_callback sets a global flag that is never
  * read from. These will be removed later on.
- * 
+ *
  * The  initialization routines of acm & msc refer to the descriptors from which,
  * among other things, they get their enpoint IDs. These are hard-coded right now
  * but it would make sense to allocate these IDs at runtime. There is, AFAICT, no
  * reason for these endpoint IDs to be 3, 1, 2 in the CDCACM case for example.
- * 
+ *
  * Allocating those at runtime would also make the setup less rigid: we can have all
  * combinations of {cdcacm, storage} interfaces without the awkward descriptor hackery
  * in epc_usb_init.
- * 
+ *
  * To generalize even further, the descriptors could be malloced. The total length of
  * the descriptor structure can easily be derived from the number of interfaces to be
  * initialized. The memory allocated will then be split up (with alignment of the single
  * descriptor structs taken care of) in a simple bump-allocator strategy on demand.
- * 
- * 
+ *
+ *
  */
 #include "usb/epc_usb.h"
 
diff --git a/epicardium/usb/epc_usb.h b/epicardium/usb/epc_usb.h
index c6917bd32..8aada2e91 100644
--- a/epicardium/usb/epc_usb.h
+++ b/epicardium/usb/epc_usb.h
@@ -2,7 +2,7 @@
 #define EPICARDIUM_USB_EPC_USB_H_INCLUDED
 
 /**
- * 
+ *
  * EPC - it's not just a Universal Serial Bus,
  * it's an Epic Serial Bus!
  */
diff --git a/pycardium/modules/py/pov.py b/pycardium/modules/py/pov.py
index e39f8c17f..c0c5af360 100644
--- a/pycardium/modules/py/pov.py
+++ b/pycardium/modules/py/pov.py
@@ -13,7 +13,7 @@ BRIGHTNESS = 1.0
 class BMPError(Exception):
     pass
 
-class POV: 
+class POV:
     def __init__(self, filename=FILENAME):
         self.filename = filename
         f = open("/" + self.filename, "rb")
@@ -60,7 +60,7 @@ class POV:
         return self.fileOffset
     def read_le(self, bytes):
         return int.from_bytes(bytes, 'little')
-    def read_image(self): 
+    def read_image(self):
         self.imageArray = []
         flip = True
         rowSize = (self.bmpWidth * 3 + 3) & ~3
@@ -81,7 +81,7 @@ class POV:
 
     def getImageArray(self):
         return self.imageArray
-    
+
     def playMe(self):
         for i in self.imageArray:
             leds.set_all(i)
diff --git a/pycardium/modules/py/pride.py b/pycardium/modules/py/pride.py
index 867e16c05..39461240f 100644
--- a/pycardium/modules/py/pride.py
+++ b/pycardium/modules/py/pride.py
@@ -103,14 +103,14 @@ def expand(colors, cutoff=12):
 def show_leds(flag="rainbow", brightness=0.5, gamma=1, cutoff=12, halo=True):
     """
     Shows pride flag on the top leds.
-    
+
     :param str flag: Chooses flag. A list of all available flags is accessible
         via print_all(). Default = 'rainbow'
     :param float brightness: Set brightness of LEDs. Default = 0.5
-    :param float gamma: Apply simple gamma correction to adjust colors. 
+    :param float gamma: Apply simple gamma correction to adjust colors.
         Default = 1
     :param int cutoff: See expand(). Default = 12
-    :param bool halo: Bottom LEDs copy outermost top LEDs if true. 
+    :param bool halo: Bottom LEDs copy outermost top LEDs if true.
         Default = True
     """
     colors = ledfx.col_cor(flags[flag], brightness, gamma)
@@ -124,7 +124,7 @@ def show_leds(flag="rainbow", brightness=0.5, gamma=1, cutoff=12, halo=True):
 def show_display(flag="rainbow", brightness=1, gamma=1):
     """
     Shows pride flag on the display.
-    
+
     :param str flag: Chooses flag. A list of all available flags is accessible
         via print_all(). Default = 'rainbow'
     :param float brightness: Set brightness of LEDs. Default = 0.5
@@ -162,7 +162,7 @@ def print_all():
 def demo(s_delay=2):
     """
     Demos all available flags on LEDs and display.
-    
+
     :param int s_delay: How long each flag is shown in seconds. Default = 2
     """
     for i in flags:
-- 
GitLab