Skip to content

Instantly share code, notes, and snippets.

@AndryG
AndryG / CaseIgnoreAutoloader.php
Last active July 30, 2023 07:43
Case insensitive autoload using composer generated classmap
<?php
/**
* Case insensitive autoload using composer generated classmap
*
* see problem:
* - https://github.com/composer/composer/issues/1803
* - https://stackoverflow.com/questions/20235922/how-to-add-case-insensitive-autoloading-using-composer-generated-classmap
*
* 1. Add this class to project. (you can set any namespace)
* 2. Add to composer.json section "scripts"
@AndryG
AndryG / reset.c
Created February 15, 2022 18:42
avr-gcc self reset
Виявляється, перезавантаження контролера має свої несподівані хитрощі.
void reset(){
wdt_enable(WDTO_15MS);
while(1);
}
// Function to disable wdt after reboot (wdt remains enabled)
void wdt_init(void) __attribute__((naked)) __attribute__((section(".init3")));
@AndryG
AndryG / hex2bin.txt
Created January 10, 2022 21:10
GNU AVR toolchain, Proteus, Microchip Studio. Initial content of Data EEPROM.
Post-build event command line:
$(ToolchainDir)\avr-objcopy -I ihex $(OutputDirectory)\$(OutputFileName).eep -O binary $(OutputDirectory)\$(OutputFileName).eep.bin
https://www.avrfreaks.net/comment/1679721#comment-1679721