Exemple #1
0
/**
  * @brief Example main entry point.
  * @par Parameters:
  * None
  * @retval 
  * None
  */
void main(void)
{

    u8 i = 0;
		u16 Timer2Count;

    /* Configuration of the GPIO*/
		GPIO_Configuration();
		
		/* Clock divider to HSI/1 */
    CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);

    /* BEEP calibration */
    BEEP_LSICalibrationConfig(LSIMeasurment());
		
		/* TS Library Initialisation */
		TSL_Init();

    /* TS Application Initialisation */
		ExtraCode_Init();

		/* Tim2 Configuration */
		InitializeTim2();

    while (1)
    {
			ExtraCode_StateMachine();
			TSL_Action();
			BeepDriver_Action();
			//SubCounterSounds();
    }

}
Exemple #2
0
/**
  ******************************************************************************
  * @brief Main function.
  * @par Parameters:
  * None
  * @retval void None
  * @par Required preconditions:
  * None
  ******************************************************************************
  */
void main(void)
{

  /* Configures clocks */
  CLK_Configuration();

  /* Configures GPIOs */
  GPIO_Configuration();

  /* Initialize Touch Sensing library */
  TSL_Init();

	/* Initialize all the Touch Sensing keys */
  ExtraCode_Init();

  /* Start the 100ms timebase Timer */
  TSL_Tick_Flags.b.User_Start_100ms = 1;

  for (;;)
  {
    /* User code */
    ExtraCode_StateMachine();

	  /* Main function of the Touch Sensing library */
    TSL_Action();

  }

}
Exemple #3
0
/**
  * @brief main entry point.
  * @par Parameters None
  * @retval void None
  * @par Required preconditions: None
  */
int main(void)
{
	int i;
 	uint8_t *pu8_tmp;

 /*!< At this stage the microcontroller clock setting is already configured,
       this is done through SystemInit() function which is called from startup
       file (startup_stm32l1xx_md.s) before to branch to application main.
       To reconfigure the default setting of SystemInit() function, refer to
       system_stm32l1xx.c file
     */
#ifdef DEBUG
	//get system config for debug purposes
	Get_system_clk_config();
#endif

	Cpu_to_default_config();
	RTC_to_default_config();
	Ports_to_default_config();
  	//Lcd_to_default_config();
	Buzzer_timer_to_default_state();
	for(i=0; i<28; i++){
		if(gSystemFlags.ms100_flag)
			gSystemFlags.ms100_flag =0;
	}
	Tsense_to_default_config();
	//Timers_to_default_config();
	Spilcd_to_default_config();
	Usart_to_default_config();
	//Usart_to_default_config();

	//get my UID
	pu8_tmp = MY_UID_0_ADDR;
	for(i=0; i<12; i++){
		gSystemFlags.system_uid[i] = *pu8_tmp;
		pu8_tmp++;
	}

	//Lcd_set();
	gSystemFlags.sys_state = SYS_STATE_INITIAL;
	while (1)
	{
		// Run TSL RC state machine
		TSL_Action();

		main_tick();



	}
}