コード例 #1
0
void Meter_GetSamples(void *pData)
{
  static uint8_t numberOfSamples = 0;

  for(;;)
  {
    OS_SemaphoreWait(SamplesReady, 0);  //Wait until the sampler module has sampled the data

    if (numberOfSamples != 16)
    {
      if (!PerformingCalculations)
      {
        //If we are not currently running calculations on these private global arrays, they are available for assignment
        VoltageSamples[numberOfSamples] = Sampler_VoltageSample;
        CurrentSamples[numberOfSamples] = Sampler_CurrentSample;
        numberOfSamples++;
      }
    }
    else
    {
      //We have collected all the required samples, signal other calculation thread to run its routines.
      numberOfSamples = 0;
      OS_SemaphoreSignal(RunCalculations);
    }
  }
}
コード例 #2
0
ファイル: main.c プロジェクト: PARTH10/embedded-software
/*!
 * @brief Runs every second in response to the RTC interrupt.
 */
void RtcCallback(void *arguments)
{
	OS_SemaphoreSignal(RtcSemaphore);
//  uint8_t h, m, s;
//  RTC_Get(&h, &m, &s);
//  CMD_SendTime(h, m, s);
//  LEDs_Toggle(LED_YELLOW);
}
コード例 #3
0
/*! @brief Callback function that is invoked when a sample is taken from the self-test waveforms.
 *
 */
void sampleCallBack(void * nothing)
{
  OS_SemaphoreSignal(SamplesReady);     //Indicate that samples are ready to be read from the 'sampler' module.
}
コード例 #4
0
ファイル: RTC.c プロジェクト: lkxlaz/uni-projects
void __attribute__ ((interrupt)) RTC_ISR(void)
{
  OS_ISREnter();
  OS_SemaphoreSignal(RTCCallbackSemaphore);
  OS_ISRExit();
}
コード例 #5
0
ファイル: main.c プロジェクト: PARTH10/embedded-software
void S2Callback(void *a)
{
	GameSwitch = bTRUE;
	OS_SemaphoreSignal(EventSemaphore);
}
コード例 #6
0
ファイル: main.c プロジェクト: PARTH10/embedded-software
void S1Callback(void *a)
{
	ToggleSwitch = bTRUE;
	OS_SemaphoreSignal(EventSemaphore);
}
コード例 #7
0
ファイル: main.c プロジェクト: PARTH10/embedded-software
void ToggleModeFinished(void *args)
{
	ToggleFinishedFlag = bTRUE;
	OS_SemaphoreSignal(EventSemaphore);
}
コード例 #8
0
ファイル: main.c プロジェクト: PARTH10/embedded-software
void GameModeFinished(void *args)
{
	GameFinishedFlag = bTRUE;
	OS_SemaphoreSignal(EventSemaphore);
}