[riot-commits] [RIOT-OS/RIOT] fd9a24: cpu/sam0_common: use generic exti_config

benpicco noreply at github.com
Wed Feb 26 08:40:51 CET 2020


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: fd9a24720062ffe5c4bb97421e0fcc21cc205461
      https://github.com/RIOT-OS/RIOT/commit/fd9a24720062ffe5c4bb97421e0fcc21cc205461
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-20 (Thu, 20 Feb 2020)

  Changed paths:
    A cpu/sam0_common/include/exti_config.h
    M cpu/sam0_common/include/periph_cpu_common.h
    M cpu/samd21/include/periph_cpu.h
    M cpu/samd5x/include/periph_cpu.h
    M cpu/saml1x/include/periph_cpu.h
    M cpu/saml21/include/periph_cpu.h

  Log Message:
  -----------
  cpu/sam0_common: use generic exti_config

Creating an `exti_config` array for a new MCU manually is tedious and error prone.
Luckiely all information is already availiable in the vendor files.

Credit for this discovery & method goes to @Sizurka

The file was generated with

```C

int main(void) {
        puts("static const int8_t exti_config[PORT_GROUPS][32] = {");

        for (unsigned port = 1; port < 5; ++port) {
                printf("#if PORT_GROUPS >= %d\n{\n", port);
                for (unsigned pin = 0; pin < 32; ++pin) {
                        printf("#ifdef PIN_P%c%02uA_EIC_EXTINT_NUM\n", '@' + port, pin);
                        printf("    PIN_P%c%02uA_EIC_EXTINT_NUM,\n", '@' + port, pin);
                        printf("#else\n    -1,\n#endif\n");
                }
                printf("},\n#endif\n\n");
        }

        puts("};");

        return 0;
}
```

No changes in generated code are expected, but this makes adding new members
of the sam0 CPU families much easier.


  Commit: a0ac2384ac0237696e9412c9b7b1452e67d76965
      https://github.com/RIOT-OS/RIOT/commit/a0ac2384ac0237696e9412c9b7b1452e67d76965
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-25 (Tue, 25 Feb 2020)

  Changed paths:
    M cpu/sam0_common/include/vendor/README.md
    M cpu/sam0_common/include/vendor/samr30/include/samr30e18a.h
    M cpu/sam0_common/include/vendor/samr30/include/samr30g18a.h

  Log Message:
  -----------
  cpu/sam0_common: samr30: add integer literal macros

All the more recent vendor files have them, so include them for samr30 too.
It is expected for this to become obsolete with the next vendor file update.


  Commit: 0edfd13df0df1a7666eb03cd054b20587db39882
      https://github.com/RIOT-OS/RIOT/commit/0edfd13df0df1a7666eb03cd054b20587db39882
  Author: benpicco <benjamin.valentin at ml-pa.com>
  Date:   2020-02-26 (Wed, 26 Feb 2020)

  Changed paths:
    A cpu/sam0_common/include/exti_config.h
    M cpu/sam0_common/include/periph_cpu_common.h
    M cpu/sam0_common/include/vendor/README.md
    M cpu/sam0_common/include/vendor/samr30/include/samr30e18a.h
    M cpu/sam0_common/include/vendor/samr30/include/samr30g18a.h
    M cpu/samd21/include/periph_cpu.h
    M cpu/samd5x/include/periph_cpu.h
    M cpu/saml1x/include/periph_cpu.h
    M cpu/saml21/include/periph_cpu.h

  Log Message:
  -----------
  Merge pull request #13310 from benpicco/sam0-exti-common

cpu/sam0_common: use generic exti_config


Compare: https://github.com/RIOT-OS/RIOT/compare/99f3f67e67eb...0edfd13df0df


More information about the commits mailing list