This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We need to ensure that c encoder will not be launched | |
@patch('json.encoder.c_make_encoder', None) | |
def json_dumps_with_two_digit_float(some_object): | |
# saving original method | |
of = json.encoder._make_iterencode | |
def inner(*args, **kwargs): | |
args = list(args) | |
# fifth argument is float formater which will we replace | |
args[4] = lambda o: '{:.2f}'.format(o) | |
return of(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lptimTick.c -- Jeff Tenney | |
// | |
// STM32 No-Drift FreeRTOS Tick/Tickless via LPTIM | |
// | |
// Example integration and validation: https://github.com/jefftenney/LPTIM-Tick | |
// | |
// Revision: 2021.11.23 | |
// Tabs: None | |
// Columns: 110 | |
// Compiler: gcc (GNU) / armcc (Arm-Keil) / iccarm (IAR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include "system_config_lptim.h" | |
#include "system_config_power.h" | |
#include "system_config_irq.h" | |
#include "FreeRTOS.h" | |
#include "FreeRTOSConfig.h" |