Renesas Synergy – pierwszy projekt w e2studio
Teraz pozostaje napisać tylko procedurę user_gpr_callback wywoływaną przy każdym zgłoszeniu przerwania od licznika GPT. Tą procedurę możemy umieścić tylko w pliku hal_entry.c – listing9.
List. 9. Procedura obsługi przerwania
volatile bool g_timer_flag;
void user_gpt_callback(timer_callback_args_t * p_args)
{
g_timer_flag = true;
}
Zmodyfikowana pętla cyklicznie gasząca i zapalająca diody LED na module ewaluacyjnym została pokazana na listingu 10.
List. 10. Miganie diodami ze zmodyfikowanym odliczaniem opóźnień
ssp_err_t err;
/* Define the units to be used with the software delay function */
const bsp_delay_units_t bsp_delay_units = BSP_DELAY_UNITS_MILLISECONDS;
/* Set the blink frequency (must be <= bsp_delay_units */
const uint32_t freq_in_hz = 2;
/* Calculate the delay in terms of bsp_delay_units */
const uint32_t delay = bsp_delay_units/freq_in_hz;
/* LED type structure */
bsp_leds_t leds;
/* LED state variable */
ioport_level_t level = IOPORT_LEVEL_HIGH;
/* Get LED information for this board */
R_BSP_LedsGet(&leds);
err = g_timer.p_api->open(g_timer.p_ctrl, g_timer.p_cfg);
if (SSP_SUCCESS != err)
{
while(1);
}
/* If this board has no LEDs then trap here */
if (0 == leds.led_count)
{
while(1); // There are no LEDs on this board
}
while(1)
{
/* Determine the next state of the LEDs */
if(IOPORT_LEVEL_LOW == level)
{
level = IOPORT_LEVEL_HIGH;
}
else
{
level = IOPORT_LEVEL_LOW;
}
/* Update all board LEDs */
for(uint32_t i = 0; i < leds.led_count; i++)
{
g_ioport.p_api->pinWrite(leds.p_leds[i], level);
}
/* Delay */
while (false == g_timer_flag);
g_timer_flag = false;
//R_BSP_SoftwareDelay(delay, bsp_delay_units);
}
Tomasz Jabłoński

Sześciu na dziesięciu liderów IT stawia na roboty. Tylko czterech jest na to gotowych
Precyzyjny pomiar dużych prądów
Kiedy obudowa staje się częścią projektu elektroniki? 

![https://www.youtube.com/watch?v=XkeyLmtLfxo O konkursie organizowanym przez firmę TRUMPF Huettinger i polskie uczelnie techniczne opowiada Alicja Peresada i prof. Jacek Rąbkowski oraz kilkoro nagrodzonych dyplomantów: mgr inż. Jakub Dobosz, inż. Maja Zielińska, dr inż. Jakub Kołodziej, dr inż Weronika Hryniewska-Guzik i dr inż. Grzegorz Bartyzel. Zapraszamy do obejrzenia filmu! [materiał redakcyjny]](https://mikrokontroler.pl/wp-content/uploads/2026/07/TRUMPF-czolowka.png)



