forked from Elron_dev/elbear_arduino_bsp
Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9eef73ebb2 | |||
| c472f4e6ae | |||
| 161a9d30ef | |||
| 97474b0bba | |||
| 96a913bfb9 | |||
| 3d7d213531 | |||
| 4a5b245a95 | |||
| 7b3d050d00 | |||
| d9cfefdc09 | |||
| 764a35d4ff | |||
| 0a5beed01e | |||
| 54feb55aa5 | |||
| 73ef03cb02 | |||
| 7b9c07026e | |||
| 201476ae45 | |||
| 3337237bab | |||
| 7c05a2bddd | |||
| f4071495c2 | |||
| 32f103240e | |||
| 97b857eb5c | |||
| 775c6f1da9 | |||
| 9f72c43590 | |||
| ea1417450b | |||
| 8e69b44932 | |||
| b8344746f9 | |||
| cc7cff834e | |||
| 47a3546a9b | |||
| f30c3c8787 | |||
| 27d96d7f35 | |||
| 68f7fbc21c | |||
| 2b82239c59 | |||
| 8db0eb96e7 | |||
| 92cf55a9c9 | |||
| a42199d6e7 | |||
| ca644b2276 | |||
| 878d419808 | |||
| 0d8fb21261 | |||
| af6526926a | |||
| e77ae5935b | |||
| 1bffc28767 | |||
| 033aaf9968 | |||
| 6e198069e9 | |||
| 58d6f95548 | |||
| a5001c2359 | |||
| 98d90f84b8 | |||
| 149d485417 | |||
| ad15de32c9 | |||
| 9b53c91156 | |||
| 87c6642cf5 | |||
| f1d4d7a770 | |||
| be75efb436 | |||
| a08d61401f | |||
| 4e806b6fc1 | |||
| 7ed3f76aa2 | |||
| c0a5927145 | |||
| 978661626c | |||
| 47c01383e6 | |||
| a7468870fc | |||
| 63217147e5 | |||
| 63e718e83f | |||
| 8f0a5b0a94 | |||
| f020720e1f | |||
| a0c4b0ff0e | |||
| 0ea1ec5b97 | |||
| 87e881aea1 |
@ -56,7 +56,7 @@ void HardwareSerial::begin(unsigned long baud, uint8_t config)
|
|||||||
// leaving the data length selected as 8 bits
|
// leaving the data length selected as 8 bits
|
||||||
|
|
||||||
// stop bit // stop bit = 1 - everything is zero, don't set anything
|
// stop bit // stop bit = 1 - everything is zero, don't set anything
|
||||||
if ((config >> 3) & (0x01 == 1)) // stop bit = 2
|
if (((config >> 3) & 0x01) == 1) // stop bit = 2
|
||||||
reg2config |= UART_CONTROL2_STOP_1_M;
|
reg2config |= UART_CONTROL2_STOP_1_M;
|
||||||
|
|
||||||
// turn on the receiver and transmitter, apply the parsed config
|
// turn on the receiver and transmitter, apply the parsed config
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include "mik32_hal_irq.h"
|
#include "mik32_hal_irq.h"
|
||||||
#include "wiring_LL.h"
|
#include "wiring_LL.h"
|
||||||
|
|
||||||
// isr functions
|
// isr functions
|
||||||
extern void serial_interrupt_handler(uint8_t uartNumInt);
|
extern void serial_interrupt_handler(uint8_t uartNumInt);
|
||||||
@ -11,34 +11,12 @@ void __attribute__((weak)) wire_interrupt_handler(void)
|
|||||||
}
|
}
|
||||||
void __attribute__((weak)) servo_interrupt_handler(void)
|
void __attribute__((weak)) servo_interrupt_handler(void)
|
||||||
{
|
{
|
||||||
// dummy function for case when servo library is not in use
|
// dummy function for case when wire library is not in use
|
||||||
}
|
|
||||||
void __attribute__((weak)) ISR(void)
|
|
||||||
{
|
|
||||||
/* A dummy function for the case when additional interrupts are not used in the project.
|
|
||||||
In the project, you need to create a function of the form:
|
|
||||||
extern "C" void ISR(void)
|
|
||||||
{
|
|
||||||
// timer16 is taken as an example
|
|
||||||
if (TIM16_GET_ARRM_INT_STATUS(htimer16_1_))
|
|
||||||
{
|
|
||||||
// necessary actions
|
|
||||||
}
|
|
||||||
// reset timer interrupt flags
|
|
||||||
TIM16_CLEAR_INT_MASK(htimer16_1_, 0xFFFFFFFF);
|
|
||||||
}
|
|
||||||
before that, be sure to connect the libraries:
|
|
||||||
#include "mik32_hal_timer16.h"
|
|
||||||
#include "mik32_hal_irq.h"
|
|
||||||
#include "wiring_LL.h" */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------- //
|
// ---------------------------------------------- //
|
||||||
void __attribute__((noinline, section(".ram_text"), optimize("O3"))) trap_handler (void)
|
void __attribute__((noinline, section(".ram_text"), optimize("O3"))) trap_handler (void)
|
||||||
{
|
{
|
||||||
// all interrupts
|
|
||||||
ISR();
|
|
||||||
|
|
||||||
// gpio interrupt
|
// gpio interrupt
|
||||||
if (EPIC_CHECK_GPIO_IRQ())
|
if (EPIC_CHECK_GPIO_IRQ())
|
||||||
gpio_interrupt_handler();
|
gpio_interrupt_handler();
|
||||||
@ -58,7 +36,7 @@ void __attribute__((noinline, section(".ram_text"), optimize("O3"))) trap_handle
|
|||||||
// uart1 interrupt
|
// uart1 interrupt
|
||||||
if (EPIC_CHECK_UART_1())
|
if (EPIC_CHECK_UART_1())
|
||||||
serial_interrupt_handler(1);
|
serial_interrupt_handler(1);
|
||||||
|
|
||||||
// i2c interrupt
|
// i2c interrupt
|
||||||
if (EPIC_CHECK_I2C_1())
|
if (EPIC_CHECK_I2C_1())
|
||||||
wire_interrupt_handler();
|
wire_interrupt_handler();
|
||||||
|
|||||||
@ -87,4 +87,3 @@ tools.mik32_upload.bootloader.params.quiet=
|
|||||||
|
|
||||||
# For Sketch > Upload Using Programmer
|
# For Sketch > Upload Using Programmer
|
||||||
tools.mik32_upload.program.pattern={path}/{cmd} {build.path}/{build.project_name}.hex --run-openocd --openocd-exec={runtime.tools.openocd.path}/bin/openocd{cmd.extension} --openocd-interface={path}/openocd-scripts/interface/ftdi/mikron-link.cfg --openocd-target={path}/openocd-scripts/target/mik32.cfg
|
tools.mik32_upload.program.pattern={path}/{cmd} {build.path}/{build.project_name}.hex --run-openocd --openocd-exec={runtime.tools.openocd.path}/bin/openocd{cmd.extension} --openocd-interface={path}/openocd-scripts/interface/ftdi/mikron-link.cfg --openocd-target={path}/openocd-scripts/target/mik32.cfg
|
||||||
tools.mik32_upload.program.params.quiet=
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user