From aa662f939aa33fbf7d7d7ac8b0dc5c1f05ce5cc0 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 18 Feb 2019 14:19:12 +0100 Subject: [PATCH] Remove OMAP4 gpio_drv test This (interactive) test has not been used for a long time and remained not updated to the current Genode API. --- repos/os/src/test/gpio_drv/gpio_test.h | 152 ------------------------- repos/os/src/test/gpio_drv/main.cc | 32 ------ repos/os/src/test/gpio_drv/target.mk | 9 -- 3 files changed, 193 deletions(-) delete mode 100644 repos/os/src/test/gpio_drv/gpio_test.h delete mode 100644 repos/os/src/test/gpio_drv/main.cc delete mode 100644 repos/os/src/test/gpio_drv/target.mk diff --git a/repos/os/src/test/gpio_drv/gpio_test.h b/repos/os/src/test/gpio_drv/gpio_test.h deleted file mode 100644 index 318a8f5c18..0000000000 --- a/repos/os/src/test/gpio_drv/gpio_test.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * \brief Test of GPIO driver - * \author Ivan Loskutov - * \date 2012-06-23 - */ - -/* - * Copyright (C) 2012 Ksys Labs LLC - * Copyright (C) 2012-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -#ifndef _GPIO_TEST_H_ -#define _GPIO_TEST_H_ - -/* Genode includes */ -#include -#include -#include -#include -#include - -using namespace Genode; - -class Gpio_test -{ - public: - - enum { - LED1_GPIO = 7, - LED2_GPIO = 8, - BUTTON_GPIO = 121, - GPIO4_IRQ = 32 + 32, - }; - - private: - - Gpio::Connection _gpio_led1; - Gpio::Connection _gpio_led2; - Gpio::Connection _gpio_button; - Gpio::Connection _gpio_irq4; - - Signal_receiver sig_rec; - Signal_context sig_ctx; - - public: - - Gpio_test(); - - void wait_for_signal() { - sig_rec.wait_for_signal(); } - - bool polling_test(); - bool irq_test(); -}; - - -Gpio_test::Gpio_test() -: _gpio_led1(LED1_GPIO), - _gpio_led2(LED2_GPIO), - _gpio_button(BUTTON_GPIO), - _gpio_irq4(GPIO4_IRQ) -{ - /* initialize GPIO_121 */ - _gpio_button.debouncing(31*100); -} - - -bool Gpio_test::polling_test() -{ - printf("---------- Polling test ----------\n"); - - printf("\nPush and hold button...\n"); - - _gpio_led1.write(true); - _gpio_led2.write(false); - - volatile bool gpio_state; - - do { - gpio_state = _gpio_button.read(); - } while (gpio_state); - - printf("OK\n"); - - _gpio_led1.write(false); - _gpio_led2.write(true); - - printf("\nRelease button...\n"); - - do { - gpio_state = _gpio_button.read(); - } while (!gpio_state); - - printf("OK\n"); - - return true; -} - -bool Gpio_test::irq_test() -{ - printf("---------- IRQ test ----------\n"); - - { - Genode::Irq_session_client - irq(_gpio_button.irq_session(Gpio::Session::FALLING_EDGE)); - irq.sigh(sig_rec.manage(&sig_ctx)); - /* - * Before any IRQs will be delivered to us, we have to signalize - * that we are ready to handle them by calling 'ack_irq()'. - */ - irq.ack_irq(); - - _gpio_led1.write(true); - _gpio_led2.write(false); - - printf("\nPush and hold button...\n"); - - wait_for_signal(); - irq.ack_irq(); - } - - printf("OK\n"); - - { - Genode::Irq_session_client - irq(_gpio_button.irq_session(Gpio::Session::RISING_EDGE)); - irq.sigh(sig_rec.manage(&sig_ctx)); - - _gpio_led1.write(false); - _gpio_led2.write(true); - - printf("\nRelease button...\n"); - - wait_for_signal(); - irq.ack_irq(); - } - - printf("OK\n"); - - { - Genode::Irq_session_client - irq(_gpio_button.irq_session(Gpio::Session::HIGH_LEVEL)); - irq.sigh(sig_rec.manage(&sig_ctx)); - } - - return true; -} - -#endif /* _GPIO_TEST_H_ */ diff --git a/repos/os/src/test/gpio_drv/main.cc b/repos/os/src/test/gpio_drv/main.cc deleted file mode 100644 index df2f42c209..0000000000 --- a/repos/os/src/test/gpio_drv/main.cc +++ /dev/null @@ -1,32 +0,0 @@ -/* - * \brief Test of GPIO driver - * \author Ivan Loskutov - * \date 2012-06-23 - */ - -/* - * Copyright (C) 2012 Ksys Labs LLC - * Copyright (C) 2012-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -#include - -#include "gpio_test.h" - -int main(int, char **) -{ - printf("--- Pandaboard button (GPIO_121) test ---\n"); - - Gpio_test gpio_test; - - while(1) - { - gpio_test.polling_test(); - gpio_test.irq_test(); - } - - return 0; -} diff --git a/repos/os/src/test/gpio_drv/target.mk b/repos/os/src/test/gpio_drv/target.mk deleted file mode 100644 index e0f4f949b0..0000000000 --- a/repos/os/src/test/gpio_drv/target.mk +++ /dev/null @@ -1,9 +0,0 @@ -TARGET = test-omap4_gpio_drv -REQUIRES = omap4 -SRC_CC = main.cc -INC_DIR += $(PRG_DIR) -LIBS = base - -vpath main.cc $(PRG_DIR) - -CC_CXX_WARN_STRICT :=