Skip to content

Instantly share code, notes, and snippets.

View pedrominatel's full-sized avatar
🇵🇹
Working from home

Pedro Minatel pedrominatel

🇵🇹
Working from home
View GitHub Profile
@pedrominatel
pedrominatel / find_partition_example.c
Last active February 3, 2021 16:15
Finding Partitions Example - Modification
/* Finding Partitions Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <string.h>
#include <assert.h>
#include "esp_partition.h"
void bytearray_to_hexstring(char * hex_string, char * byte_array, uint8_t hex_string_size)
{
char hex_tab[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F', };
unsigned char byte;
for(uint8_t i = 0; i < (hex_string_size/2); i++)
{
byte = *byte_array++;
*hex_string++ = hex_tab[byte >> 4];
#!/usr/bin/python
from datetime import datetime
import serial
import time
serial_ob = serial.Serial(port='/dev/ttyUSB0',baudrate=115200)
filename = datetime.now().strftime('datalog_%Y%m%d_%H%M%S')
/*
* Copyright (C) 2014 BlueKitchen GmbH
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright