|
|
|
@@ -17,7 +17,6 @@
|
|
|
|
|
#include "jerry-libc.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __TARGET_MCU
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wpedantic"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
|
|
|
@@ -30,7 +29,6 @@
|
|
|
|
|
#define LED_ORANGE 13
|
|
|
|
|
#define LED_RED 14
|
|
|
|
|
#define LED_BLUE 15
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
@@ -64,11 +62,6 @@ wait_ms (uint32_t time_ms)
|
|
|
|
|
// 1 millisecond = 1,000,000 Nanoseconds
|
|
|
|
|
#define NANO_SECOND_MULTIPLIER 1000000
|
|
|
|
|
__printf ("wait_ms: %d\n", time_ms);
|
|
|
|
|
// const long interval_ms = time_ms * NANO_SECOND_MULTIPLIER;
|
|
|
|
|
//
|
|
|
|
|
// timespec sleep_value = {0};
|
|
|
|
|
// sleep_value.tv_nsec = interval_ms;
|
|
|
|
|
// nanosleep (&sleep_value, NULL);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef __TARGET_MCU
|
|
|
|
@@ -81,7 +74,8 @@ wait_ms (uint32_t time_ms)
|
|
|
|
|
|
|
|
|
|
#ifdef __TARGET_MCU
|
|
|
|
|
|
|
|
|
|
void initialize_timer()
|
|
|
|
|
void
|
|
|
|
|
initialize_timer ()
|
|
|
|
|
{
|
|
|
|
|
RCC_APB1PeriphClockCmd (RCC_APB1Periph_TIM2, ENABLE);
|
|
|
|
|
|
|
|
|
@@ -107,24 +101,17 @@ fake_exit (void)
|
|
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dot; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dot; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dot; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dash; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dash; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dash; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dot; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dot; index++); gpio->BSRRH = (uint16_t) (1 << pin); for (index = 0; index < dash; index++);
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin); for (index = 0; index < dot; index++); gpio->BSRRH = (uint16_t) (1 << pin);
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < dash * 7; index++);
|
|
|
|
|
gpio->BSRRL = (uint16_t) (1 << pin);
|
|
|
|
|
for ( index = 0; index < dot; index ++)
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
gpio->BSRRH = (uint16_t) (1 << pin);
|
|
|
|
|
for (index = 0; index < dash; index ++)
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static __IO uint32_t sys_tick_counter;
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@@ -153,7 +140,9 @@ get_sys_tick_counter(void)
|
|
|
|
|
return sys_tick_counter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SysTick_Handler(void) {
|
|
|
|
|
void
|
|
|
|
|
SysTick_Handler (void)
|
|
|
|
|
{
|
|
|
|
|
time_tick_decrement ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|