Clean up board specific functions.

This commit is contained in:
NIIBE Yutaka 2010-10-19 13:56:43 +09:00
parent 8a88c279bf
commit e614fad8db
7 changed files with 42 additions and 76 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# generated files by 'configure'
src/Makefile
src/config.h
src/gnuk.ld

View File

@ -45,3 +45,21 @@ void hwinit0(void) {
void hwinit1(void) {
#include "../common/hwinit1.c"
}
void
USB_Cable_Config (FunctionalState NewState)
{
if (NewState != DISABLE)
palClearPad (IOPORT3, GPIOC_DISC);
else
palSetPad (IOPORT3, GPIOC_DISC);
}
void
set_led (int value)
{
if (value)
palClearPad (IOPORT3, GPIOC_LED);
else
palSetPad (IOPORT3, GPIOC_LED);
}

View File

@ -1,6 +1,6 @@
# List of all the board related files.
BOARDSRC = ../boards/OLIMEX_STM32_H103/board.c \
../boards/OLIMEX_STM32_H103/hw_config.c
../boards/common/hw_config.c
# Required include directories
BOARDINC = ../boards/OLIMEX_STM32_H103

View File

@ -51,3 +51,21 @@ void hwinit1(void) {
palClearPad (IOPORT5, GPIOE_LED);
palClearPad (IOPORT3, GPIOC_SHUTDOWN);
}
void
USB_Cable_Config (FunctionalState NewState)
{
if (NewState != DISABLE)
palClearPad (IOPORT4, GPIOD_DISC);
else
palSetPad (IOPORT4, GPIOD_DISC);
}
void
set_led (int value)
{
if (value)
palClearPad (IOPORT5, GPIOE_LEDR);
else
palSetPad (IOPORT5, GPIOE_LEDR);
}

View File

@ -1,6 +1,6 @@
# List of all the board related files.
BOARDSRC = ../boards/STM32_PRIMER2/board.c \
../boards/STM32_PRIMER2/hw_config.c
../boards/common/hw_config.c
# Required include directories
BOARDINC = ../boards/STM32_PRIMER2

View File

@ -1,56 +0,0 @@
/* Hardware specific USB functions */
/*
* For detail, please see the documentation of
* STM32F10x USB Full Speed Device Library (USB-FS-Device_Lib)
* by STMicroelectronics' MCD Application Team
*/
#include "ch.h"
#include "hal.h"
#include "board.h"
#include "usb_lib.h"
#include "usb_prop.h"
#include "usb_desc.h"
#include "hw_config.h"
#include "platform_config.h"
#include "usb_pwr.h"
void
Enter_LowPowerMode (void)
{
bDeviceState = SUSPENDED;
}
void
Leave_LowPowerMode (void)
{
DEVICE_INFO *pInfo = &Device_Info;
if (pInfo->Current_Configuration != 0)
bDeviceState = CONFIGURED;
else
bDeviceState = ATTACHED;
}
void
USB_Cable_Config (FunctionalState NewState)
{
if (NewState != DISABLE)
palClearPad (IOPORT4, GPIOD_DISC);
else
palSetPad (IOPORT4, GPIOD_DISC);
}
void
Get_SerialNum (void)
{
}
void
set_led (int value)
{
if (value)
palClearPad (IOPORT5, GPIOE_LEDR);
else
palSetPad (IOPORT5, GPIOE_LEDR);
}

View File

@ -32,25 +32,7 @@ Leave_LowPowerMode (void)
bDeviceState = ATTACHED;
}
void
USB_Cable_Config (FunctionalState NewState)
{
if (NewState != DISABLE)
palClearPad (IOPORT3, GPIOC_DISC);
else
palSetPad (IOPORT3, GPIOC_DISC);
}
void
Get_SerialNum (void)
{
}
void
set_led (int value)
{
if (value)
palClearPad (IOPORT3, GPIOC_LED);
else
palSetPad (IOPORT3, GPIOC_LED);
}