瀏覽代碼

Add FLASHMEM, for assigning functions (not variables) to flash

teensy4-core
PaulStoffregen 6 年之前
父節點
當前提交
5aeeb9ad58
共有 3 個檔案被更改,包括 3 行新增0 行删除
  1. +1
    -0
      keywords.txt
  2. +1
    -0
      teensy4/avr/pgmspace.h
  3. +1
    -0
      teensy4/imxrt1062.ld

+ 1
- 0
keywords.txt 查看文件

attachRts KEYWORD2 attachRts KEYWORD2
attachCts KEYWORD2 attachCts KEYWORD2
PROGMEM LITERAL1 PROGMEM LITERAL1
FLASHMEM LITERAL1
DMAMEM LITERAL1 DMAMEM LITERAL1
FASTRUN LITERAL1 FASTRUN LITERAL1
Serial4 KEYWORD1 Serial4 KEYWORD1

+ 1
- 0
teensy4/avr/pgmspace.h 查看文件

#define DMAMEM __attribute__ ((section(".dmabuffers"), used)) #define DMAMEM __attribute__ ((section(".dmabuffers"), used))
#define FASTRUN __attribute__ ((section(".fastrun") )) #define FASTRUN __attribute__ ((section(".fastrun") ))
#define PROGMEM __attribute__((section(".progmem"))) #define PROGMEM __attribute__((section(".progmem")))
#define FLASHMEM __attribute__((section(".flashmem")))


#define PGM_P const char * #define PGM_P const char *
#define PSTR(str) ({static const char data[] PROGMEM = (str); &data[0];}) #define PSTR(str) ({static const char data[] PROGMEM = (str); &data[0];})

+ 1
- 0
teensy4/imxrt1062.ld 查看文件

KEEP(*(.bootdata)) KEEP(*(.bootdata))
KEEP(*(.vectors)) KEEP(*(.vectors))
KEEP(*(.startup)) KEEP(*(.startup))
*(.flashmem*)
*(.progmem*) *(.progmem*)
. = ALIGN(4); . = ALIGN(4);
KEEP(*(.init)) KEEP(*(.init))

Loading…
取消
儲存