Add a RAMFUNC function attribute to have functions copied to and run from ram.
Fix "blew circular buffer" error in hf 14a snoop by executing SnoopIso14443a from ram (eats about 3.5k of ram)
// maybe processed in some way.
uint32_t BigBuf[8000];
// maybe processed in some way.
uint32_t BigBuf[8000];
+// This may be used (sparingly) to declare a function to be copied to
+// and executed from RAM
+#define RAMFUNC __attribute((long_call, section(".ramfunc")))
+
/// appmain.h
void ReadMem(int addr);
void __attribute__((noreturn)) AppMain(void);
/// appmain.h
void ReadMem(int addr);
void __attribute__((noreturn)) AppMain(void);
void SnoopIso14443(void);
/// iso14443a.h
void SnoopIso14443(void);
/// iso14443a.h
-void SnoopIso14443a(void);
+void RAMFUNC SnoopIso14443a(void);
void SimulateIso14443aTag(int tagType, int TagUid); // ## simulate iso14443a tag
void ReaderIso14443a(UsbCommand * c, UsbCommand * ack);
void ReaderMifare(uint32_t parameter);
void SimulateIso14443aTag(int tagType, int TagUid); // ## simulate iso14443a tag
void ReaderIso14443a(UsbCommand * c, UsbCommand * ack);
void ReaderMifare(uint32_t parameter);
-static int MillerDecoding(int bit)
+static RAMFUNC int MillerDecoding(int bit)
{
int error = 0;
int bitright;
{
int error = 0;
int bitright;
uint8_t *output;
} Demod;
uint8_t *output;
} Demod;
-static int ManchesterDecoding(int v)
+static RAMFUNC int ManchesterDecoding(int v)
{
int bit;
int modulation;
{
int bit;
int modulation;
// triggering so that we start recording at the point that the tag is moved
// near the reader.
//-----------------------------------------------------------------------------
// triggering so that we start recording at the point that the tag is moved
// near the reader.
//-----------------------------------------------------------------------------
-void SnoopIso14443a(void)
+void RAMFUNC SnoopIso14443a(void)
{
// #define RECV_CMD_OFFSET 2032 // original (working as of 21/2/09) values
// #define RECV_RES_OFFSET 2096 // original (working as of 21/2/09) values
{
// #define RECV_CMD_OFFSET 2032 // original (working as of 21/2/09) values
// #define RECV_RES_OFFSET 2096 // original (working as of 21/2/09) values
.data : {
*(.data)
*(.data.*)
.data : {
*(.data)
*(.data.*)
. = ALIGN(4);
} >ram AT>osimage :data
. = ALIGN(4);
} >ram AT>osimage :data