README: use ``diff …``

This commit is contained in:
Astro 2017-11-02 23:04:00 +01:00 committed by GitHub
parent e035419b67
commit f87fa4d8d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,42 @@
4) Install OpenOCD >= version 0.9, and install gcc-arm-none-eabi 4) Install OpenOCD >= version 0.9, and install gcc-arm-none-eabi
5) git checkout https://bitbucket.org/rebane/rtl8710/src 5) git checkout https://bitbucket.org/rebane/rtl8710/src
6) Replace in Makefile "interface/stlink-v2-1.cfg" with "interface/stlink-v2.cfg" 6) Replace in Makefile "interface/stlink-v2-1.cfg" with "interface/stlink-v2.cfg"
```diff
diff --git Makefile Makefile
index 4581f9a..66a3be5 100644
--- Makefile
+++ Makefile
@@ -24,8 +24,8 @@ clean:
rm -rf $(FILENAME_PREFIX).bin $(FILENAME_PREFIX).elf
install:
- openocd -f interface/stlink-v2-1.cfg -f rtl8710.ocd -f cortex/cortex.ocd -c "init" -c "reset halt" -c "load_image $(FILENAME_PREFIX).bin $(ADDRESS) bin" -c "cortex_bootstrap $(ADDRESS)" -c "shutdown"
+ openocd -f interface/stlink-v2.cfg -f rtl8710.ocd -f cortex/cortex.ocd -c "init" -c "reset halt" -c "load_image $(FILENAME_PREFIX).bin $(ADDRESS) bin" -c "cortex_bootstrap $(ADDRESS)" -c "shutdown"
reset:
- openocd -f interface/stlink-v2-1.cfg -f rtl8710.ocd -c "init" -c "reset halt" -c "reset run" -c "shutdown"
+ openocd -f interface/stlink-v2.cfg -f rtl8710.ocd -c "init" -c "reset halt" -c "reset run" -c "shutdown"
```
7) Change blinking GPIO to RtlDuino's onboard LED: 7) Change blinking GPIO to RtlDuino's onboard LED:
main.c: ```diff
Replace in references to GPIO_PORTA_* (last 3 occurences): diff --git main.c main.c
(((uint32_t)1) << 8) -> (((uint32_t)1) << 6) index f32c716..b18b811 100644
--- main.c
+++ main.c
@@ -8,12 +8,12 @@ void delay(uint32_t delay){
int main(){
*(volatile uint32_t *)0x4000021C |= (((uint32_t)1) << 8); // REG_SOC_PERI_FUNC1_EN |= BIT_PERI_GPIO_EN; (enable gpio peripheral)
- *(volatile uint32_t *)0x40001004 |= (((uint32_t)1) << 8); // GPIO_PORTA_DDR |= ...???; (set gpio to output, GC4 on B&T RTL-00)
+ *(volatile uint32_t *)0x40001004 |= (((uint32_t)1) << 6); // GPIO_PORTA_DDR |= ...???; (set gpio to output, GC4 on B&T RTL-00)
while(1){
- *(volatile uint32_t *)0x40001000 |= (((uint32_t)1) << 8); // GPIO_PORTA_DR |= ...???; (pin high)
+ *(volatile uint32_t *)0x40001000 |= (((uint32_t)1) << 6); // GPIO_PORTA_DR |= ...???; (pin high)
delay(1000000);
- *(volatile uint32_t *)0x40001000 &= ~(((uint32_t)1) << 8); // GPIO_PORTA_DR &= ~...???; (pin low)
+ *(volatile uint32_t *)0x40001000 &= ~(((uint32_t)1) << 6); // GPIO_PORTA_DR &= ~...???; (pin low)
delay(1000000);
}
}
```