- Previous cast was to a function pointer was not legal
- Using already present function pointer to store the IAP entry point to improve
readability. (Which also fixes the cast issue.)
- arm_reset was completely undocumented, even though technical details buried
deeply in the data sheet of the LPC2387 are involved in the code
- The attribute "naked" is misplaced, it should only be used when no C code
is present. However, the function consists of C code only
- The attribute "noreturn" has to be used in the declaration [1] of a function,
not in the implementation. Otherwise the caller is not informed and code using
the function will not be optimized.
[1]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
- Fixed documentation
- Use bitwise operation instead of multiplication and addition in `GPIO_PIN()`
- Allow GPIOs to be configured as input via `gpio_init()`
- Fixed bugs in `gpio_init_mux`:
- `0x01 << ((pin & 31) * 2)` was used before to generate the bitmask, but
this would shift by 62 to the left. Correct is `0x01 << ((pin & 15) * 2)`
(See [datasheet](https://www.nxp.com/docs/en/user-guide/UM10211.pdf) at
pages 156ff)
- Only one of the two bits was cleared previously
- Changed strategy to access GPIO pins:
- Previous strategy:
- Set all bits in FIOMASK except the one for the pin to control to
disable access to them
- Set/clear/read all pins in the target GPIO port (but access to all but
the target pin is ignored because of the applied FIOMASK)
- New strategy:
- Set/clear/read only the target pin
- Advantages:
- Only one access to a GPIO register instead of two
- Proven approach: Access to GPIOs on lpc2387 is mostly done by
accessing the GPIO registers directy (e.g. see the sht11 driver).
Those accesses never touch the FIOMASK register
- No unwanted side effects: Disabling all but one pin in a GPIO port
without undoing that seems not to be a good idea
At `lpc2387-mci.c:383` in `send_cmd()` an `assert()` enforces that parameter
`buff` is not `NULL`. At `lpc2387-mci.c:538` in `mci_initialize()` `send_cmd()`
was called with `buff==NULL`.
In commit 513b20ffd3 the SPI API was changed to
power up an configure the SPI bus on spi_acquire(). Sadly, the lpc2387 SPI
apparently needs to be reconfigured after each power up. This commit moves
the initialization code required after each power up from spi_init() to
spi_acquire().
- removed ISR_STACKSIZE define where unused (set to 0)
- removed thread_arch_isr_stack_usage(), thread_arch_isr_stack_start(),
and/or thread_arch_isr_stack_pointer() where not implemented