moo
/
bit-band
bit-band test
Fork of bit-band by
main.cpp
- Committer:
- moo
- Date:
- 2014-06-02
- Revision:
- 0:cd40794dcbe8
- Child:
- 1:95cec43280f9
File content as of revision 0:cd40794dcbe8:
#include "mbed.h" DigitalOut led1(LED1); extern "C" void HardFault_Handler() {__nop();} int main() { volatile uint8_t *a1 = (uint8_t*)(0x10000000); // SRAM先頭アドレス *a1 = (uint8_t)0x1; // Memory windowsにて0x1になることを確認 volatile uint8_t *a2 = (uint8_t*)(0x22000000); // SRAM先頭アドレスをbit-bandで指定 *a2 = (uint8_t)0x0; // Memory windowsにて0x01になることを確認出来ない led1 = *a1; // この行を実行するとHardFault_Handler()が実行される while (1); }