[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.0-2646-g2fb02b9
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2011-12-13 10:18:36
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 2fb02b9b068a037baa77c09c1d802e24c154b4c4 (commit)
via 7a49037a599ecd23e3137b32f43baf02c0924330 (commit)
via dd0534ac0c63e3bc5189a0a41880f50f396cec92 (commit)
via 0be5a7d930253174f1357129f4fa9136fcfbb215 (commit)
via 679afd2ad4d1d3c9f3ec3176429a33f4ae80f7a6 (commit)
from c3ce1a39a0e50dd7ffa35a51bd64ceb7c03f7724 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2fb02b9b068a037baa77c09c1d802e24c154b4c4
Merge: 7a49037 c3ce1a3
Author: Fabien Marteau <fab...@ar...>
Date: Tue Dec 13 11:18:05 2011 +0100
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 7a49037a599ecd23e3137b32f43baf02c0924330
Author: Fabien Marteau <fab...@ar...>
Date: Tue Dec 13 11:15:10 2011 +0100
[linux][driver][fpga][wishbone_example] adding test program for button and led
commit dd0534ac0c63e3bc5189a0a41880f50f396cec92
Author: Fabien Marteau <fab...@ar...>
Date: Tue Dec 13 11:00:25 2011 +0100
[linux][driver][fpga][button] adding test program for wishbone_example button
commit 0be5a7d930253174f1357129f4fa9136fcfbb215
Author: Fabien Marteau <fab...@ar...>
Date: Tue Dec 13 10:56:43 2011 +0100
[firmware][wishbone_example] Update bitstream for apf51 to work with board drivers
commit 679afd2ad4d1d3c9f3ec3176429a33f4ae80f7a6
Author: Fabien Marteau <fab...@ar...>
Date: Tue Dec 13 10:52:54 2011 +0100
[linux][driver][fpga][led] adding testled program
-----------------------------------------------------------------------
Summary of changes:
.../binaries/top_wishbone_example51_lx9.bin | Bin 340604 -> 340604 bytes
.../fpga/board_designs/wishbone_example/Makefile | 7 ++-
.../fpga/board_designs/wishbone_example/push-led.c | 39 ++++++--------
.../wishbone_example/wb_button/Makefile | 5 +--
.../wishbone_example/wb_button}/testbutton.c | 57 +++++++++-----------
.../board_designs/wishbone_example/wb_led/Makefile | 5 +--
.../wishbone_example/wb_led}/testled.c | 1 +
7 files changed, 52 insertions(+), 62 deletions(-)
copy {firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus => target/linux/modules/fpga/board_designs/wishbone_example/wb_button}/testbutton.c (66%)
copy target/linux/modules/fpga/{virtual_components/led => board_designs/wishbone_example/wb_led}/testled.c (99%)
diff --git a/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin b/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin
index 96c84f8..35c6ba7 100644
Binary files a/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin and b/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin differ
diff --git a/target/linux/modules/fpga/board_designs/wishbone_example/Makefile b/target/linux/modules/fpga/board_designs/wishbone_example/Makefile
index 7300da2..f463ee8 100644
--- a/target/linux/modules/fpga/board_designs/wishbone_example/Makefile
+++ b/target/linux/modules/fpga/board_designs/wishbone_example/Makefile
@@ -13,11 +13,16 @@ obj-$(CONFIG_ARMADEUS_FPGA_BOARD_DESIGNS_WISHBONE_EXAMPLE) += wb_button/ wb_irq
else
# Armadeus custom drivers common targets (default, clean, etc...)
-include ../../../Makefile.in
+ARMADEUS_BASE_DIR=../../../../../../
+include $(ARMADEUS_BASE_DIR)/Makefile.in
install:
echo "Installing Armadeus drivers..."
$(MAKE) -C $(LINUX_DIR) SUBDIRS=$(PWD) INSTALL_MOD_PATH=$(TARGET_DIR) modules_install
+test:
+ $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc push-led.c -o push-led
+
+
endif
diff --git a/target/linux/modules/fpga/board_designs/wishbone_example/push-led.c b/target/linux/modules/fpga/board_designs/wishbone_example/push-led.c
index 20ac3ba..6b6bc2f 100644
--- a/target/linux/modules/fpga/board_designs/wishbone_example/push-led.c
+++ b/target/linux/modules/fpga/board_designs/wishbone_example/push-led.c
@@ -63,41 +63,36 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- fbutton=open(argv[1],O_RDWR);
- if(fbutton<0){
- perror("can't open button file\n");
- exit(EXIT_FAILURE);
- }
while(1){
+ fbutton=open(argv[1],O_RDWR);
+ if(fbutton<0){
+ perror("can't open button file\n");
+ exit(EXIT_FAILURE);
+ }
+
/* read button value */
if(read(fbutton,&j,1)<0){
perror("read error\n");
exit(EXIT_FAILURE);
}
- if(lseek(fbutton,0,SEEK_SET)<0){
- perror("lseek error\n");
+ /* write led value */
+ fled=open(argv[2],O_RDWR);
+ if(fbutton<0){
+ perror("can't open led file\n");
exit(EXIT_FAILURE);
}
-
- /* write led value */
- fled=open(argv[2],O_RDWR);
- if(fbutton<0){
- perror("can't open led file\n");
- exit(EXIT_FAILURE);
- }
-
- if(write(fled,&j,2)<=0){
- perror("LED write error\n");
- exit(EXIT_FAILURE);
- }
- close(fled);
+
+ if(write(fled,&j,2)<=0){
+ perror("LED write error\n");
+ exit(EXIT_FAILURE);
+ }
+ close(fled);
+ close(fbutton);
}
- close(fbutton);
- close(fled);
exit(0);
}
diff --git a/target/linux/modules/fpga/board_designs/wishbone_example/wb_button/Makefile b/target/linux/modules/fpga/board_designs/wishbone_example/wb_button/Makefile
index 3dae375..cef6f50 100755
--- a/target/linux/modules/fpga/board_designs/wishbone_example/wb_button/Makefile
+++ b/target/linux/modules/fpga/board_designs/wishbone_example/wb_button/Makefile
@@ -8,15 +8,12 @@ obj-$(CONFIG_ARMADEUS_FPGA_BOARD_DESIGNS_WISHBONE_EXAMPLE_BUTTON_DRIVER) += wb_e
wb_example_buttons-objs := board_buttons.o
else
-ARMADEUS_BASE_DIR=../../../../../..
+ARMADEUS_BASE_DIR=../../../../../../../
include $(ARMADEUS_BASE_DIR)/Makefile.in
KDIR := $(ARMADEUS_LINUX_DIR)
PWD := $(shell pwd)
-# Armadeus custom drivers common targets (default, clean, etc...)
-include ../../../Makefile.in
-
test:
$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc testbutton.c -o testbutton
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/testbutton.c b/target/linux/modules/fpga/board_designs/wishbone_example/wb_button/testbutton.c
similarity index 66%
copy from firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/testbutton.c
copy to target/linux/modules/fpga/board_designs/wishbone_example/wb_button/testbutton.c
index 8765669..520dd17 100644
--- a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/testbutton.c
+++ b/target/linux/modules/fpga/board_designs/wishbone_example/wb_button/testbutton.c
@@ -1,14 +1,9 @@
-/* a program to write/read values on fpga address map
- * Fabien Marteau <fab...@ar...>
- * 7 april 2008
- * fpgaaccess.h
+/*
+ * A simple program to test Wishbone button driver
*
* (c) Copyright 2008 Armadeus project
* Fabien Marteau <fab...@ar...>
*
- * A simple driver for reading and writing on
- * fpga throught a character file /dev/fpgaaccess
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -38,53 +33,53 @@
/* sleep */
#include <unistd.h>
-int fled;
+int fbutton;
-void quit(int pouet){
- close(fled);
+void quit(int pouet) {
+ close(fbutton);
exit(0);
}
+void usage(char *exe) {
+ if (exe) {
+ printf("\nUsage:\n");
+ printf("%s <button_device>\n", exe);
+ }
+}
+
int main(int argc, char *argv[])
{
- unsigned short i,j;
+ unsigned short i, j=0;
/* quit when Ctrl-C pressed */
signal(SIGINT, quit);
- j=0;
-
printf( "Testing button driver\n" );
- if(argc < 2){
- perror("invalide arguments number\ntestled <button_filename>\n");
- exit(EXIT_FAILURE);
- }
-
- fled=open(argv[1],O_RDWR);
- if(fled<0){
- perror("can't open file\n");
+ if (argc < 2) {
+ printf("invalid arguments number\n");
+ usage(argv[0]);
exit(EXIT_FAILURE);
}
- while(1){
- i = (i==0)?1:0;
- fflush(stdout);
+ while (1) {
+ fbutton = open(argv[1], O_RDWR);
+ if (fbutton < 0) {
+ perror("can't open file");
+ exit(EXIT_FAILURE);
+ }
/* read value */
- if(read(fled,&j,1)<0){
- perror("read error\n");
+ if (read(fbutton, &j, 1) < 0) {
+ perror("read error");
exit(EXIT_FAILURE);
}
printf("Read %d\n",j);
- if(lseek(fled,0,SEEK_SET)<0){
- perror("lseek error\n");
- exit(EXIT_FAILURE);
- }
+ close(fbutton);
}
- close(fled);
exit(0);
}
+
diff --git a/target/linux/modules/fpga/board_designs/wishbone_example/wb_led/Makefile b/target/linux/modules/fpga/board_designs/wishbone_example/wb_led/Makefile
index eae0571..7bf86a5 100755
--- a/target/linux/modules/fpga/board_designs/wishbone_example/wb_led/Makefile
+++ b/target/linux/modules/fpga/board_designs/wishbone_example/wb_led/Makefile
@@ -9,15 +9,12 @@ wb_example_led-objs := board_leds.o
else
-ARMADEUS_BASE_DIR=../../../../../..
+ARMADEUS_BASE_DIR=../../../../../../../
include $(ARMADEUS_BASE_DIR)/Makefile.in
KDIR := $(ARMADEUS_LINUX_DIR)
PWD := $(shell pwd)
-# Armadeus custom drivers common targets (default, clean, etc...)
-include ../../../Makefile.in
-
test:
$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc -Wall testled.c -o testled
chmod 755 testled
diff --git a/target/linux/modules/fpga/virtual_components/led/testled.c b/target/linux/modules/fpga/board_designs/wishbone_example/wb_led/testled.c
similarity index 99%
copy from target/linux/modules/fpga/virtual_components/led/testled.c
copy to target/linux/modules/fpga/board_designs/wishbone_example/wb_led/testled.c
index 0c399b9..191a030 100644
--- a/target/linux/modules/fpga/virtual_components/led/testled.c
+++ b/target/linux/modules/fpga/board_designs/wishbone_example/wb_led/testled.c
@@ -130,3 +130,4 @@ int main(int argc, char *argv[])
close(fled);
exit(0);
}
+
hooks/post-receive
--
armadeus
|