keybrd library is an open source library for creating custom-keyboard firmware.
Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.
123456789101112131415161718192021222324252627282930313233343536 |
- // getFreeSRAM.h copied from
- // http://andybrown.me.uk/2011/01/01/debugging-avr-dynamic-memory-allocation/
- /*
- * memdebug.h
- *
- * Created on: 15 Dec 2010
- * Author: Andy Brown
- *
- * Use without attribution is permitted provided that this
- * header remains intact and that these terms and conditions
- * are followed:
- *
- * http://andybrown.me.uk/ws/terms-and-conditions
- */
-
- #include <inttypes.h>
-
- extern unsigned int __bss_end;
- extern unsigned int __heap_start;
- extern void *__brkval;
-
- //measure and return amount of free SRAM
- uint16_t getFreeSRAM()
- {
- uint8_t newVariable;
- // if heap is empty, use bss as start memory address
- if ((uint16_t)__brkval == 0)
- {
- return (((uint16_t)&newVariable) - ((uint16_t)&__bss_end));
- }
- // else use heap end as the start of the memory address
- else
- {
- return (((uint16_t)&newVariable) - ((uint16_t)__brkval));
- }
- };
|