Delete board.[ch]. Add reset_button.h

This commit is contained in:
László Monda
2016-10-04 16:44:16 +02:00
parent 9172493642
commit 0550c19cf5
10 changed files with 10 additions and 56 deletions

View File

@@ -1,42 +0,0 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _BOARD_H_
#define _BOARD_H_
#include "fsl_gpio.h"
#define BOARD_SW2_GPIO GPIOC
#define BOARD_SW2_PORT PORTC
#define BOARD_SW2_GPIO_PIN 1
#define BOARD_SW2_IRQ PORTC_IRQn
#define BOARD_SW2_IRQ_HANDLER PORTC_IRQHandler
#endif /* _BOARD_H_ */

View File

@@ -30,8 +30,8 @@
#include "fsl_common.h"
#include "fsl_port.h"
#include "board.h"
#include "test_led.h"
#include "reset_button.h"
void BOARD_InitPins(void)
{
@@ -46,13 +46,12 @@ void BOARD_InitPins(void)
.pullSelect = kPORT_PullUp,
.mux = kPORT_MuxAsGpio,
};
PORT_SetPinConfig(BOARD_SW2_PORT, BOARD_SW2_GPIO_PIN, &switchConfig);
PORT_SetPinConfig(RESET_BUTTON_PORT, RESET_BUTTON_PIN, &switchConfig);
// Initialize LEDs.
PORT_SetPinMux(TEST_LED_GPIO_PORT, TEST_LED_GPIO_PIN, kPORT_MuxAsGpio);
TEST_LED_INIT(LOGIC_LED_ON);
// GPIO_SetPinsOutput(TEST_LED_GPIO, 1 << TEST_LED_GPIO_PIN);
TEST_LED_INIT(0);
// Initialize I2C.

View File

@@ -31,7 +31,6 @@
#ifndef _PIN_MUX_H_
#define _PIN_MUX_H_
#include "include/board/board.h"
#include "fsl_common.h"
#if defined(__cplusplus)

View File

@@ -1,6 +1,5 @@
#include "fsl_i2c.h"
#include "include/board/clock_config.h"
#include "include/board/board.h"
#include "include/board/pin_mux.h"
#include "usb_composite_device.h"
#include "fsl_common.h"

View File

@@ -1,4 +1,3 @@
#include "include/board/board.h"
#include "usb_composite_device.h"
#include "usb_interface_generic_hid.h"

View File

@@ -1,5 +1,4 @@
#include "fsl_port.h"
#include "include/board/board.h"
#include "usb_api.h"
#include "usb_composite_device.h"
#include "test_led.h"

View File

@@ -1,8 +1,8 @@
#include "include/board/board.h"
#include "usb_composite_device.h"
#include "usb_interface_mouse.h"
#include "fsl_i2c.h"
#include "i2c.h"
#include "reset_button.h"
static usb_device_endpoint_struct_t UsbMouseEndpoints[USB_MOUSE_ENDPOINT_COUNT] = {{
USB_MOUSE_ENDPOINT_INDEX | (USB_IN << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
@@ -58,7 +58,7 @@ static volatile usb_status_t UsbMouseAction(void)
UsbMouseReport.wheelX = 0;
UsbMouseReport.wheelY = 0;
if (!GPIO_ReadPinInput(BOARD_SW2_GPIO, BOARD_SW2_GPIO_PIN)) {
if (!GPIO_ReadPinInput(RESET_BUTTON_GPIO, RESET_BUTTON_PIN)) {
if (!(scrollCounter % 10)) {
UsbMouseReport.wheelX = -1;
}