aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTitanMKD2012-06-25 22:12:00 +0200
committerTitanMKD2012-06-25 22:12:00 +0200
commit81317c02ab3c33e820fe4852c053476a33c6f834 (patch)
treefc78b6fcdd55e540c3aa9446fb816282343b8d7f
parent397af2540179c9615044b66dff3b05f8cf0b19b3 (diff)
* Updated GPIO added gpio_toggle() function.
* Fixed ROM to RAM Linker script (libopencm3_lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld).
-rw-r--r--include/libopencm3/lpc43xx/gpio.h1
-rw-r--r--lib/lpc43xx/gpio.c7
-rw-r--r--lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld6
3 files changed, 10 insertions, 4 deletions
diff --git a/include/libopencm3/lpc43xx/gpio.h b/include/libopencm3/lpc43xx/gpio.h
index 6052887..8abd546 100644
--- a/include/libopencm3/lpc43xx/gpio.h
+++ b/include/libopencm3/lpc43xx/gpio.h
@@ -155,5 +155,6 @@
void gpio_set(u32 gpioport, u32 gpios);
void gpio_clear(u32 gpioport, u32 gpios);
+void gpio_toggle(u32 gpioport, u32 gpios);
#endif
diff --git a/lib/lpc43xx/gpio.c b/lib/lpc43xx/gpio.c
index 9134f70..1256fd0 100644
--- a/lib/lpc43xx/gpio.c
+++ b/lib/lpc43xx/gpio.c
@@ -26,5 +26,10 @@ void gpio_set(u32 gpioport, u32 gpios)
void gpio_clear(u32 gpioport, u32 gpios)
{
- GPIO_CLR(gpioport) = gpios;
+ GPIO_CLR(gpioport) = gpios;
}
+
+void gpio_toggle(u32 gpioport, u32 gpios)
+{
+ GPIO_NOT(gpioport) = gpios;
+} \ No newline at end of file
diff --git a/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld b/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
index 850218b..0270ea8 100644
--- a/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
+++ b/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
@@ -36,7 +36,7 @@ SECTIONS
.text : {
. = ALIGN(0x400);
- _text_ram = . + ORIGIN(ram); /* Start of Code in RAM */
+ _text_ram = (. - ORIGIN(rom)) + ORIGIN(ram); /* Start of Code in RAM */
*(.vectors) /* Vector table */
*(.text*) /* Program code */
@@ -53,8 +53,8 @@ SECTIONS
__exidx_end = .;
_etext = .;
- _etext_ram = . + ORIGIN(ram);
- _etext_rom = . + ORIGIN(rom_flash);
+ _etext_ram = (. - ORIGIN(rom)) + ORIGIN(ram);
+ _etext_rom = (. - ORIGIN(rom)) + ORIGIN(rom_flash);
.data : {
_data = .;