diff --git a/Documentation/bluetooth/card10.rst b/Documentation/bluetooth/card10.rst index 2991fa2ff019e8c224211c2232ad84c75d3c0dc0..2530d00da1b3efac8f29141bb462a365b58e2a35 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 4c34ca0290a243dd264bddf33edc65ff240a4cdd..b28bb9e52e8c1fc7940b27d175520c919abe1cdd 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 b152bf75f58bc22170a040547b3e441d096b4439..041337a2df84c6a324126f1f69e5dcc88ddc68b8 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 0c7277ca1d61145fb7c7ccb2ada581ee783d2258..f5c6f568a2159de62aa9707dab5d1032414d4119 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 b1ed2276478dbbadb86515f012948b8cc74d401a..dfbc96339a8fdb38afec2dd593df89eeecb1caac 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 7f896bfe47fe90aa2992848c37ecc716efd29a0a..c7fa728a42afdf5049268980a1d77deb15019524 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 df888a744442b814656bc44224457c602f815fb5..e3897c44956e80ed8213ae789a28271e4bb56445 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 c06c7bc5ae0d4ed35760fd54103f7cf7c879822b..79ccce44b86d46a858ec97527d2fb5aa0a6331d3 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 f2398732994160a13b949f79825060221d53587f..f617054319da5ecc573a3bd29dff011832ef2eaa 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 8d0fe25368b7891d8781f7738962d5e699662c7a..a0cf2a0c84340da1f35772982770583a10a756c3 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 db54a2895621d0e316dee83c362faac737b1a9e2..2b89398bef63e2739bb9da307ce69f3dda2a16bd 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 5129042559d6af9079a0464dc419b6021a3678e3..1e23c99cfbb2a805cc82ab071e0abbbb2e1b9eb7 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 a3e9f33db00d53c1029aee8eaf98a26dd5307363..d909516262987bacbf654d522235b2e9af96fcc9 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 b99c34a075689a1f470fd66119359f844547bd6a..e9502436514f4f4d432a43bd2318ceceb612927d 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 c6917bd328b270f240ab38a7c8e11f10aa4fea21..8aada2e917568c74068b2c66a224818974edafa5 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 e39f8c17fcff8351d0ff1c8d5d3d6978ccd19b1c..c0c5af360a7457356b9b65ba858d74e649a637c6 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 867e16c05d27f0881765c070303a823e20dae95a..39461240f2b0ee595eb4b47bd53d09eec063d4ac 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: