Skip to content

Instantly share code, notes, and snippets.

View iwasz's full-sized avatar
💭
sdfsdfgdsfggerg

Łukasz Iwaszkiewicz iwasz

💭
sdfsdfgdsfggerg
View GitHub Profile
@Sukonnik-Illia
Sukonnik-Illia / my_json_dums.py
Last active August 25, 2023 09:20
Python 3 Json with 2 decimals after comma
# 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)
@jefftenney
jefftenney / lptimTick.c
Last active May 21, 2023 17:02
No-Drift FreeRTOS tick/tickless for STM32 via LPTIM
// 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)
@JayKickliter
JayKickliter / tickless.c
Created January 16, 2020 22:53
FreeRTOS tickless idle with STM32 LPTIM
#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"