Commit fd55dc36 authored by Rahix's avatar Rahix
Browse files

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's avatarRahix <rahix@rahix.de>
parent f0d94559
...@@ -196,7 +196,7 @@ Accessing services from a linux system is possible via ``btgatt-client``. The in ...@@ -196,7 +196,7 @@ Accessing services from a linux system is possible via ``btgatt-client``. The in
.. code-block:: .. code-block::
# pairing the card10: # pairing the card10:
$ bluetoothctl $ bluetoothctl
[bluetooth]# power on [bluetooth]# power on
[bluetooth]# scan on [bluetooth]# scan on
...@@ -213,7 +213,7 @@ Accessing services from a linux system is possible via ``btgatt-client``. The in ...@@ -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: # if this error appears remove and re-pair:
[GATT client]# Device disconnected: Software caused connection abort [GATT client]# Device disconnected: Software caused connection abort
ARM Cordio Sources ARM Cordio Sources
------------------ ------------------
......
...@@ -56,7 +56,7 @@ the following commands: ...@@ -56,7 +56,7 @@ the following commands:
.. warning:: .. warning::
Make sure ``CMSIS-DAP Compliant Debugger`` is set to **yes (auto)** after 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`` 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``. ``touch doc/openocd.info`` to skip it and continue with ``make``.
.. code-block:: shell-session .. code-block:: shell-session
...@@ -118,7 +118,7 @@ command to soft-reset card10. ...@@ -118,7 +118,7 @@ command to soft-reset card10.
.. note:: .. note::
You will also find the following self-describing gdb files in the firmware You will also find the following self-describing gdb files in the firmware
root directory, which do not require additional arguments: 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`` flash-both.gdb, flash-epicardium.gdb, flash-pycardium.gdb``
.. warning:: .. warning::
......
...@@ -29,7 +29,7 @@ Dependencies ...@@ -29,7 +29,7 @@ Dependencies
dnf install arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib 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 You can use `Homebrew`_ to install the required tools. The version of the
ARM crosscompiler tool chain is quite important; with the wrong version, 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. ...@@ -176,12 +176,12 @@ Otherwise, rerunning ``./bootstrap.sh`` will also clean the build-directory.
.. note:: .. 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. 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 ~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 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 (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" LC_ALL environment variable to be not set, or set to "C"
(but not UTF8 or similar). (but not UTF8 or similar).
Docker Docker
......
...@@ -40,7 +40,7 @@ appUiCback_t appUiCbackTbl; ...@@ -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 * this to be called before the BTLE app starts making advertisements. Avoids encryption
* rendering the frame unreadable. * rendering the frame unreadable.
* *
......
...@@ -339,7 +339,7 @@ static void bleSetup(bleMsg_t *pMsg) ...@@ -339,7 +339,7 @@ static void bleSetup(bleMsg_t *pMsg)
bleScanDataDisc[14] = f; bleScanDataDisc[14] = f;
} }
} }
/* set advertising and scan response data for discoverable mode */ /* set advertising and scan response data for discoverable mode */
AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(bleAdvDataDisc), (uint8_t *) bleAdvDataDisc); AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(bleAdvDataDisc), (uint8_t *) bleAdvDataDisc);
AppAdvSetData(APP_SCAN_DATA_DISCOVERABLE, sizeof(bleScanDataDisc), (uint8_t *) bleScanDataDisc); AppAdvSetData(APP_SCAN_DATA_DISCOVERABLE, sizeof(bleScanDataDisc), (uint8_t *) bleScanDataDisc);
......
...@@ -235,7 +235,7 @@ static const uint8_t UUID_attChar_personal_state[] = { ...@@ -235,7 +235,7 @@ static const uint8_t UUID_attChar_personal_state[] = {
CARD10_UUID_SUFFIX, 0x19, CARD10_UUID_PREFIX CARD10_UUID_SUFFIX, 0x19, CARD10_UUID_PREFIX
}; };
static uint8_t personalStateValue = 0; static uint8_t personalStateValue = 0;
static uint16_t personalStateLen = sizeof(personalStateValue); static uint16_t personalStateLen = sizeof(personalStateValue);
/* BLE UUID for card10 above leds */ /* BLE UUID for card10 above leds */
...@@ -280,7 +280,7 @@ static uint16_t initLightSensorLen = sizeof(initLightSensorValue); ...@@ -280,7 +280,7 @@ static uint16_t initLightSensorLen = sizeof(initLightSensorValue);
/* clang-format on */ /* clang-format on */
/* /*
* Create the BLE service description. * Create the BLE service description.
*/ */
static const attsAttr_t card10SvcAttrList[] = { static const attsAttr_t card10SvcAttrList[] = {
......
/* /*
* BLE (Bluetooth Low energy) file transfer service. * BLE (Bluetooth Low energy) file transfer service.
* *
* This file provides a BLE service and a characteristic which allows to * 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. * 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 * We haven't found any existing BLE service which provides such a
* functionality so we implemented our own service. * functionality so we implemented our own service.
* The service uses the UUID in fileTransSvc * The service uses the UUID in fileTransSvc
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
* BLE point to point links use a pretty small MTU (min 23 bytes, max 244 * 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). * bytes) which is negotiated between the central and the peripheral (card10).
* *
* The first byte of each message is the type of message being send, * 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 * different types are supported and based on this type the next bytes
* have different meaning. * have different meaning.
* *
* TODOs: * TODOs:
* * File deletion * * File deletion
* * File read * * File read
...@@ -180,7 +180,7 @@ static const attsAttr_t fileTransCfgList[] = { ...@@ -180,7 +180,7 @@ static const attsAttr_t fileTransCfgList[] = {
/** /**
* Send a repose with an optional CRC. * Send a repose with an optional CRC.
* *
* The Central RX characteristic is filled and a notification is send in addition. * The Central RX characteristic is filled and a notification is send in addition.
* If msg is given message is added in addition. * If msg is given message is added in addition.
*/ */
...@@ -222,7 +222,7 @@ static void sendCrcResponse( ...@@ -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. * creates all the missing folders.
*/ */
static int bleFileCreateOrOpen(char *filepath) static int bleFileCreateOrOpen(char *filepath)
...@@ -377,7 +377,7 @@ static uint8_t handleCentralTX( ...@@ -377,7 +377,7 @@ static uint8_t handleCentralTX(
/* /*
* BLE file transfer write callback. * BLE file transfer write callback.
* *
* This gets called when data is written by a BLE central to our BLE * This gets called when data is written by a BLE central to our BLE
* peripheral. Here we take care of handling the received data. * peripheral. Here we take care of handling the received data.
*/ */
......
...@@ -137,7 +137,7 @@ void StackInit(void) ...@@ -137,7 +137,7 @@ void StackInit(void)
#endif /* DATS_APP_USE_LEGACY_API */ #endif /* DATS_APP_USE_LEGACY_API */
if(memUsed != LL_MEMORY_FOOTPRINT) 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); (unsigned int)LL_MEMORY_FOOTPRINT);
} }
#endif #endif
......
...@@ -914,9 +914,9 @@ struct max86150_sensor_data { ...@@ -914,9 +914,9 @@ struct max86150_sensor_data {
/** /**
* Enable a MAX86150 PPG and ECG sensor. * Enable a MAX86150 PPG and ECG sensor.
* *
* Calling this function will instruct the MAX86150 to collect a * Calling this function will instruct the MAX86150 to collect a
* data from the sensor. You can then retrieve the samples using * data from the sensor. You can then retrieve the samples using
* :c:func:`epic_stream_read`. * :c:func:`epic_stream_read`.
* *
* :param max86150_sensor_config* config: Configuration for this sensor. * :param max86150_sensor_config* config: Configuration for this sensor.
......
...@@ -33,7 +33,7 @@ int efs_rename(EpicFileSystem *fs, const char *oldp, const char *newp); ...@@ -33,7 +33,7 @@ int efs_rename(EpicFileSystem *fs, const char *oldp, const char *newp);
int efs_mkdir(EpicFileSystem *fs, const char *dirname); int efs_mkdir(EpicFileSystem *fs, const char *dirname);
/** /**
* lock global filesystem * lock global filesystem
* *
* locks the global mutex and, if the global EpicFileSystem has been initialized correctly * locks the global mutex and, if the global EpicFileSystem has been initialized correctly
* passes it to *fs * passes it to *fs
* *
......
...@@ -16,7 +16,7 @@ void fatfs_init(void); ...@@ -16,7 +16,7 @@ void fatfs_init(void);
/** /**
* initialize and mount the FLASH storage * initialize and mount the FLASH storage
* *
* NOTE: not safe to be called from an ISR * NOTE: not safe to be called from an ISR
*/ */
int fatfs_attach(void); int fatfs_attach(void);
...@@ -24,7 +24,7 @@ int fatfs_attach(void); ...@@ -24,7 +24,7 @@ int fatfs_attach(void);
/** /**
* asynchronously attach the FLASH storage * asynchronously attach the FLASH storage
* *
* safe to be called from an ISR * safe to be called from an ISR
*/ */
void fatfs_schedule_attach(void); void fatfs_schedule_attach(void);
...@@ -32,7 +32,7 @@ void fatfs_schedule_attach(void); ...@@ -32,7 +32,7 @@ void fatfs_schedule_attach(void);
/** close all opened FDs, sync and deinitialize FLASH layer */ /** close all opened FDs, sync and deinitialize FLASH layer */
void fatfs_detach(void); void fatfs_detach(void);
/** close all onpened FDs /** close all onpened FDs
* TODO: add ability to close FDs opened by core0/core1 only * TODO: add ability to close FDs opened by core0/core1 only
*/ */
#define EPICARDIUM_COREMASK_0 0x01 #define EPICARDIUM_COREMASK_0 0x01
......
/** /**
* *
* Implementation of public epic_usb_ interface * Implementation of public epic_usb_ interface
* *
* Configuration and FLASH-specific implementation of USB mass storage device * Configuration and FLASH-specific implementation of USB mass storage device
* Configuration of USB CDCACM device * Configuration of USB CDCACM device
* *
* USB descriptors for both are defined here. * USB descriptors for both are defined here.
* *
*/ */
#include "epicardium.h" #include "epicardium.h"
......
/** /**
* *
* epicardium-specific implemnetation of cdcacm device * epicardium-specific implemnetation of cdcacm device
* services CDCACM API * services CDCACM API
*/ */
......
/** /**
* *
* *
* Core of the USB implementation: * Core of the USB implementation:
* *
* - device independent * - device independent
* - handles setup of MAXUSB stack * - handles setup of MAXUSB stack
* - handles events and state of the MAXUSB stack * - handles events and state of the MAXUSB stack
* *
* Also contains definitions of device-independent String descriptors * Also contains definitions of device-independent String descriptors
* *
* *
* *
* *
* *
* swym's USB ramblings: * swym's USB ramblings:
* *
* setting up USB basically consists of two parts: * setting up USB basically consists of two parts:
* *
* - set up descriptors * - set up descriptors
* - initialize the corresponding MAXUSB stacks - acm, msc... * - initialize the corresponding MAXUSB stacks - acm, msc...
* *
* at the moment, the descriptors are statically configured in * at the moment, the descriptors are statically configured in
* descriptors.h several descriptors point to enumeration descriptors * descriptors.h several descriptors point to enumeration descriptors
* via iFooBar indices. Those enumeration descriptors are registered * via iFooBar indices. Those enumeration descriptors are registered
* via enum_register_descriptor(type, desc, idx), where the idx passed * via enum_register_descriptor(type, desc, idx), where the idx passed
* corresponds to the iFooBar index mentioned above. * corresponds to the iFooBar index mentioned above.
* *
* There are several callbacks, some of which do not perform anything meaningful * 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 * at the moment. For example usb_write_callback sets a global flag that is never
* read from. These will be removed later on. * read from. These will be removed later on.
* *
* The initialization routines of acm & msc refer to the descriptors from which, * 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 * 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 * 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. * 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 * 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 * combinations of {cdcacm, storage} interfaces without the awkward descriptor hackery
* in epc_usb_init. * in epc_usb_init.
* *
* To generalize even further, the descriptors could be malloced. The total length of * 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 * 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 * 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. * descriptor structs taken care of) in a simple bump-allocator strategy on demand.
* *
* *
*/ */
#include "usb/epc_usb.h" #include "usb/epc_usb.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define EPICARDIUM_USB_EPC_USB_H_INCLUDED #define EPICARDIUM_USB_EPC_USB_H_INCLUDED
/** /**
* *
* EPC - it's not just a Universal Serial Bus, * EPC - it's not just a Universal Serial Bus,
* it's an Epic Serial Bus! * it's an Epic Serial Bus!
*/ */
......
...@@ -13,7 +13,7 @@ BRIGHTNESS = 1.0 ...@@ -13,7 +13,7 @@ BRIGHTNESS = 1.0
class BMPError(Exception): class BMPError(Exception):
pass pass
class POV: class POV:
def __init__(self, filename=FILENAME): def __init__(self, filename=FILENAME):
self.filename = filename self.filename = filename
f = open("/" + self.filename, "rb") f = open("/" + self.filename, "rb")
...@@ -60,7 +60,7 @@ class POV: ...@@ -60,7 +60,7 @@ class POV:
return self.fileOffset return self.fileOffset
def read_le(self, bytes): def read_le(self, bytes):
return int.from_bytes(bytes, 'little') return int.from_bytes(bytes, 'little')
def read_image(self): def read_image(self):
self.imageArray = [] self.imageArray = []
flip = True flip = True
rowSize = (self.bmpWidth * 3 + 3) & ~3 rowSize = (self.bmpWidth * 3 + 3) & ~3
...@@ -81,7 +81,7 @@ class POV: ...@@ -81,7 +81,7 @@ class POV:
def getImageArray(self): def getImageArray(self):
return self.imageArray return self.imageArray
def playMe(self): def playMe(self):
for i in self.imageArray: for i in self.imageArray:
leds.set_all(i) leds.set_all(i)
......
...@@ -103,14 +103,14 @@ def expand(colors, cutoff=12): ...@@ -103,14 +103,14 @@ def expand(colors, cutoff=12):
def show_leds(flag="rainbow", brightness=0.5, gamma=1, cutoff=12, halo=True): def show_leds(flag="rainbow", brightness=0.5, gamma=1, cutoff=12, halo=True):
""" """
Shows pride flag on the top leds. Shows pride flag on the top leds.
:param str flag: Chooses flag. A list of all available flags is accessible :param str flag: Chooses flag. A list of all available flags is accessible
via print_all(). Default = 'rainbow' via print_all(). Default = 'rainbow'
:param float brightness: Set brightness of LEDs. Default = 0.5 :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 Default = 1
:param int cutoff: See expand(). Default = 12 :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 Default = True
""" """
colors = ledfx.col_cor(flags[flag], brightness, gamma) 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): ...@@ -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): def show_display(flag="rainbow", brightness=1, gamma=1):
""" """
Shows pride flag on the display. Shows pride flag on the display.
:param str flag: Chooses flag. A list of all available flags is accessible :param str flag: Chooses flag. A list of all available flags is accessible
via print_all(). Default = 'rainbow' via print_all(). Default = 'rainbow'
:param float brightness: Set brightness of LEDs. Default = 0.5 :param float brightness: Set brightness of LEDs. Default = 0.5
...@@ -162,7 +162,7 @@ def print_all(): ...@@ -162,7 +162,7 @@ def print_all():
def demo(s_delay=2): def demo(s_delay=2):
""" """
Demos all available flags on LEDs and display. Demos all available flags on LEDs and display.
:param int s_delay: How long each flag is shown in seconds. Default = 2 :param int s_delay: How long each flag is shown in seconds. Default = 2
""" """
for i in flags: for i in flags:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment