1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Made a start on function comments

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@14 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
dankers 2009-11-29 05:16:47 +00:00 committed by dankers
parent 4f36f10c1a
commit 9b77b473c4
3 changed files with 74 additions and 5 deletions

View File

@ -37,7 +37,7 @@
#include <queue.h>
/* FreeRTOS Tasks */
/* FreeRTOS Prototypes */
void PiosMainTask( void *pvParameters );
void SensorTask( void *pvParameters );

View File

@ -25,9 +25,19 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
/* Public Function Prototypes */
int IRQDisable(void);
int IRQEnable(void);
/* Private Function Prototypes */
/* Local Variables */
/* The nesting counter ensures, that interrupts won't be enabled so long nested functions disable them */
static unsigned int nested_ctr;
@ -35,7 +45,14 @@ static unsigned int nested_ctr;
/* Stored priority level before IRQ has been disabled (important for co-existence with vPortEnterCritical) */
static unsigned int prev_primask;
/* Disables all interrupts (nested) */
/*******************************************************************************
* Function Name : IRQDisable
* Description : Disables all interrupts (nested)
* Input : None
* Output : None
* Return : Zero on no error
*******************************************************************************/
int IRQDisable(void)
{
/* Get current priority if nested level == 0 */
@ -59,7 +76,14 @@ int IRQDisable(void)
return 0;
}
/* Enables all interrupts (nested) */
/*******************************************************************************
* Function Name : IRQEnable
* Description : Enables all interrupts (nested)
* Input : None
* Output : None
* Return : Zero on no error, -1 on nesting error
*******************************************************************************/
int IRQEnable(void)
{
/* Check for nesting error */

View File

@ -25,13 +25,34 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
/* Public Function Prototypes */
void LED_INIT(void);
void LED_ON(LedTypeDef LEDNum);
void LED_OFF(LedTypeDef LEDNum);
void LED_TOGGLE(LedTypeDef LEDNum);
/* Private Function Prototypes */
/* Local Variables */
GPIO_TypeDef* LED_GPIO_PORT[NUM_LED] = {LED1_GPIO_PORT, LED2_GPIO_PORT};
const uint16_t LED_GPIO_PIN[NUM_LED] = {LED1_GPIO_PIN, LED2_GPIO_PIN};
const uint32_t LED_GPIO_CLK[NUM_LED] = {LED1_GPIO_CLK, LED2_GPIO_CLK};
/* Initialises all the LED's */
/*******************************************************************************
* Function Name : LED_INIT
* Description : Initialises all the LED's
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void LED_INIT(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
@ -45,16 +66,40 @@ void LED_INIT(void)
}
}
/*******************************************************************************
* Function Name : LED_ON
* Description : Turn on LED
* Input : LED Number
* Output : None
* Return : None
*******************************************************************************/
void LED_ON(LedTypeDef LEDNum)
{
LED_GPIO_PORT[LEDNum]->BSRR = LED_GPIO_PIN[LEDNum];
}
/*******************************************************************************
* Function Name : LED_OFF
* Description : Turn off LED
* Input : LED Number
* Output : None
* Return : None
*******************************************************************************/
void LED_OFF(LedTypeDef LEDNum)
{
LED_GPIO_PORT[LEDNum]->BRR = LED_GPIO_PIN[LEDNum];
}
/*******************************************************************************
* Function Name : LED_TOGGLE
* Description : Turn on/off LED
* Input : LED Number
* Output : None
* Return : None
*******************************************************************************/
void LED_TOGGLE(LedTypeDef LEDNum)
{
LED_GPIO_PORT[LEDNum]->ODR ^= LED_GPIO_PIN[LEDNum];