ソースを参照

Change `getIsrTable` from `inline` to `static inline`

Newer versions of GCC (8.1.0 in my case) default to `-std=gnu11` (I believe), which expects `inline` to have an external definition. The `Makefile` (I ran it with `NO_ARDUINO` set) doesn't specify any C_FLAGS. Therefore gcc uses the new default value, instead of the old C99 standard. In this case you'll get a linker error for `getIsrTable` not being defined. This change allows the code to successfully compile with new versions of gcc. This change works with the old default std of gcc. For much older versions of gcc it might be better to explicitly set the `std` in `CFLAGS` within the `Makefile`.
main
Jon Eyolfson 6年前
コミット
41705a8324
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更1行の追加1行の削除
  1. +1
    -1
      teensy3/pins_teensy.c

+ 1
- 1
teensy3/pins_teensy.c ファイルの表示

@@ -166,7 +166,7 @@ voidFuncPtr isr_table_portE[CORE_MAX_PIN_PORTE+1] = { [0 ... CORE_MAX_PIN_PORTE]

// The Pin Config Register is used to look up the correct interrupt table
// for the corresponding port.
inline voidFuncPtr* getIsrTable(volatile uint32_t *config) {
static inline voidFuncPtr* getIsrTable(volatile uint32_t *config) {
voidFuncPtr* isr_table = NULL;
if(&PORTA_PCR0 <= config && config <= &PORTA_PCR31) isr_table = isr_table_portA;
else if(&PORTB_PCR0 <= config && config <= &PORTB_PCR31) isr_table = isr_table_portB;

読み込み中…
キャンセル
保存