Skip to content

Instantly share code, notes, and snippets.

View HoseanRC's full-sized avatar
🏢
Working at RTH company

HoseanRC

🏢
Working at RTH company
View GitHub Profile
@HoseanRC
HoseanRC / eeprom.c
Last active December 18, 2024 13:06
native xc8 eeprom_read and eeprom_write functions to support structures instead of char array (imagine storing all your data in bits and splitted bytes manually when c can do it by itself!)
void readEE(void *var_struct, void *eeprom_struct, size_t struct_size)
{
unsigned char *var_pointer = (unsigned char *)var_struct;
unsigned char eeprom_pointer = (unsigned char)eeprom_struct;
for (unsigned char i = 0; i < struct_size; i++)
{
// based on __eeread.c in xc8 library
do
CLRWDT();
#if _EEPROM_INT == _EEREG_INT
@HoseanRC
HoseanRC / Exercises.md
Created December 14, 2024 05:43
15 University python exercises

Exercise 1:

print("test #1");

print(int(input("Enter number: ")[::-1]) * 2);

Run:

~/uni-python $ python 1.py