Update test apps.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 18 Oct 2007 09:36:26 +0000 (09:36 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 18 Oct 2007 09:36:26 +0000 (09:36 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@892 38d2e660-2303-0410-9eaa-f027e97ec537

app/at91sam7s/at91sam7s.c
app/at91sam7s/at91sam7s.mk
app/at91sam7s/hw/hw_cpu.h
app/triface/triface.mk

index 8db8afdda4b36c3915c87589f53000cd5b454ece..b088247f90fc47494e1a4597edf3c9e152b4a44d 100644 (file)
  */
 
 #include <drv/timer.h>
+#include <drv/sysirq_at91.h>
 #include <cfg/macros.h>
+#include <io/at91sam7s.h>
+
+int iort = 23;
+int iort1 = 232;
+int iort2 = 233;
+
+Timer leds_timer;
+
+static void leds_toggle(void)
+{
+       uint8_t a = (~PIOA_ODSR & 0x0f);
+
+       if (a)
+       {
+               PIOA_SODR = a;
+               PIOA_CODR = a << 1;
+       }
+       else
+       {
+               PIOA_SODR  =  0x0f;
+               /* turn first led on */
+               PIOA_CODR  = 0x00000001;
+       }
+
+       /* Wait for interval time */
+       timer_setDelay(&leds_timer, ms_to_ticks(100));
+       timer_add(&leds_timer);
+}
+
 
 int main(void)
 {
-//     kdbg_init();
+       //kdbg_init();
+       sysirq_init();
        timer_init();
        IRQ_ENABLE;
 
+       /* Disable all pullups */
+       PIOA_PUDR = 0xffffffff;
+       /* Set all port pin connected to PIOA */
+       PIOA_PER  = 0xffffffff;
+       /* Set PA0..3 as output */
+       PIOA_OER  = 0x0000000f;
+       /* Disable multidrive on all pins */
+       PIOA_MDDR = 0x0000000f;
+
+       /* Set PA0..3 to 1 to turn off leds */
+       PIOA_SODR  = 0x0000000f;
+       /* turn first led on */
+       PIOA_CODR  = 0x00000001;
+
+       timer_set_event_softint(&leds_timer, (Hook)leds_toggle, 0);
+       timer_setDelay(&leds_timer, ms_to_ticks(100));
+       timer_add(&leds_timer);
+
+
        // Main loop
        for(;;)
        {
-
+               iort+= 1;
+               iort1+= 1;
+               iort2+= 1;
        }
 
        return 0;
 }
+
index 926dd9e6aae641bf4093675b52152001233c2db4..858670aa0943d2edf9f7826c5e6b3fa9582cf36f 100644 (file)
@@ -19,11 +19,15 @@ TRG += at91sam7s
 at91sam7s_CSRC = \
        app/at91sam7s/at91sam7s.c \
        drv/timer.c \
-       drv/at91/sysirq.c
+       cpu/arm/drv/sysirq_at91.c \
+       mware/event.c
 
-at91sam7s_PCSRC += mware/formatwr.c
+at91sam7s_CPPASRC = cpu/arm/hw/crtat91sam7s256_rom.S
+
+at91sam7s_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug
+at91sam7s_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7S256__ -g3 -gdwarf-2 -fverbose-asm -Iapp/at91sam7s/hw -Iapp/at91sam7s -Icpu/arm
+at91sam7s_LDFLAGS = -nostartfiles -T cpu/arm/scripts/at91sam7s256_rom.ld -Wl,--no-warn-mismatch
 
-at91sam7s_CFLAGS = -O3 -D'ARCH=0' -Iapp/at91sam7s/hw -Iapp/at91sam7s
 at91sam7s_CPU = arm7tdmi
 
 # Debug stuff
index 0b46cc7c0a3f48b2362f8cd5ec55c93e36332f1a..f95458dd896fe323f4ca5d3b03d1f9a56dff72f9 100644 (file)
 #ifndef AT91SAM7SEK_HW_H
 #define AT91SAM7SEK_HW_H
 
-#include <appconfig.h>
-
-/// CPU Clock frequency (14.7456 MHz)
-#define CLOCK_FREQ     (14745600UL)
+/// CPU Clock frequency (48.023 MHz)
+#define CLOCK_FREQ     (48023000UL)
 
 
 /* Timer IRQ strobe */
index c1d095dccef8eb111165a11964103468a2a6af9f..bc0d7d044cebdb1e71cb724aed72e4efbe2f9b48 100644 (file)
@@ -31,7 +31,7 @@ triface_CSRC = \
        app/triface/protocol.c \
        drv/timer.c \
        drv/ser.c \
-       drv/ser_avr.c \
+       cpu/avr/drv/ser_avr.c \
        mware/formatwr.c \
        mware/hex.c \
        mware/hashtable.c \
@@ -43,7 +43,7 @@ triface_CSRC = \
 triface_PCSRC += mware/formatwr.c
 
 #triface_CFLAGS = -O3 -D'ARCH=0' -Iapp/triface/hw -Iapp/triface
-triface_CFLAGS = -O0 -D'ARCH=0' -Iapp/triface/hw -Iapp/triface
+triface_CFLAGS = -O0 -D'ARCH=0' -Iapp/triface/hw -Iapp/triface -Icpu/avr
 triface_MCU = atmega128
 
 # Debug stuff