Updated to the new locm3 changed to stdint types.
This commit is contained in:
@@ -26,22 +26,22 @@
|
||||
#include <libopencm3/stm32/can.h>
|
||||
|
||||
struct can_tx_msg {
|
||||
u32 std_id;
|
||||
u32 ext_id;
|
||||
u8 ide;
|
||||
u8 rtr;
|
||||
u8 dlc;
|
||||
u8 data[8];
|
||||
uint32_t std_id;
|
||||
uint32_t ext_id;
|
||||
uint8_t ide;
|
||||
uint8_t rtr;
|
||||
uint8_t dlc;
|
||||
uint8_t data[8];
|
||||
};
|
||||
|
||||
struct can_rx_msg {
|
||||
u32 std_id;
|
||||
u32 ext_id;
|
||||
u8 ide;
|
||||
u8 rtr;
|
||||
u8 dlc;
|
||||
u8 data[8];
|
||||
u8 fmi;
|
||||
uint32_t std_id;
|
||||
uint32_t ext_id;
|
||||
uint8_t ide;
|
||||
uint8_t rtr;
|
||||
uint8_t dlc;
|
||||
uint8_t data[8];
|
||||
uint8_t fmi;
|
||||
};
|
||||
|
||||
struct can_tx_msg can_tx_msg;
|
||||
@@ -151,7 +151,7 @@ static void can_setup(void)
|
||||
void sys_tick_handler(void)
|
||||
{
|
||||
static int temp32 = 0;
|
||||
static u8 data[8] = {0, 1, 2, 0, 0, 0, 0, 0};
|
||||
static uint8_t data[8] = {0, 1, 2, 0, 0, 0, 0, 0};
|
||||
|
||||
/* We call this handler every 1ms so 1000ms = 1s on/off. */
|
||||
if (++temp32 != 1000)
|
||||
@@ -177,9 +177,9 @@ void sys_tick_handler(void)
|
||||
|
||||
void usb_lp_can_rx0_isr(void)
|
||||
{
|
||||
u32 id, fmi;
|
||||
uint32_t id, fmi;
|
||||
bool ext, rtr;
|
||||
u8 length, data[8];
|
||||
uint8_t length, data[8];
|
||||
|
||||
can_receive(CAN1, 0, false, &id, &ext, &rtr, &fmi, &length, data);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
* Iout = Iin ** gamma
|
||||
*/
|
||||
#ifdef GAMMA_LINEAR
|
||||
static const u16 gamma_table_linear[] = {
|
||||
static const uint16_t gamma_table_linear[] = {
|
||||
1, 4, 9, 17, 26, 37, 51, 67,
|
||||
84, 104, 126, 149, 175, 203, 233, 265,
|
||||
299, 334, 372, 412, 454, 499, 545, 593,
|
||||
@@ -86,7 +86,7 @@ static const u16 gamma_table_linear[] = {
|
||||
#endif
|
||||
|
||||
#ifdef GAMMA_1_3
|
||||
static const u16 gamma_table_1_3[] = {
|
||||
static const uint16_t gamma_table_1_3[] = {
|
||||
/* Gamma 1.3 */
|
||||
0, 49, 120, 203, 296, 395, 501, 612,
|
||||
728, 848, 973, 1101, 1233, 1368, 1506, 1648,
|
||||
@@ -124,7 +124,7 @@ static const u16 gamma_table_1_3[] = {
|
||||
#endif
|
||||
|
||||
#ifdef GAMMA_2_2
|
||||
static const u16 gamma_table_2_2[] = {
|
||||
static const uint16_t gamma_table_2_2[] = {
|
||||
0, 0, 2, 4, 7, 11, 17, 24,
|
||||
32, 42, 53, 65, 79, 94, 111, 129,
|
||||
148, 169, 192, 216, 242, 270, 299, 330,
|
||||
@@ -161,7 +161,7 @@ static const u16 gamma_table_2_2[] = {
|
||||
#endif
|
||||
|
||||
#ifdef GAMMA_2_5
|
||||
static const u16 gamma_table_2_5[] = {
|
||||
static const uint16_t gamma_table_2_5[] = {
|
||||
/* gamma = 2.5 */
|
||||
0, 0, 0, 1, 2, 4, 6, 8,
|
||||
11, 15, 20, 25, 31, 38, 46, 55,
|
||||
@@ -199,7 +199,7 @@ static const u16 gamma_table_2_5[] = {
|
||||
#endif
|
||||
|
||||
#ifdef GAMMA_3_0
|
||||
static const u16 gamma_table_3_0[] = {
|
||||
static const uint16_t gamma_table_3_0[] = {
|
||||
/* gamma = 3.0 */
|
||||
0, 0, 0, 0, 0, 0, 1, 1,
|
||||
2, 3, 4, 5, 7, 9, 11, 13,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <libopencm3/cm3/nvic.h>
|
||||
#include <libopencm3/cm3/systick.h>
|
||||
|
||||
u32 temp32;
|
||||
uint32_t temp32;
|
||||
|
||||
static void gpio_setup(void)
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ static void gpio_setup(void)
|
||||
|
||||
void usart1_isr(void)
|
||||
{
|
||||
static u8 data = 'A';
|
||||
static uint8_t data = 'A';
|
||||
|
||||
/* Check if we were called because of RXNE. */
|
||||
if (((USART_CR1(USART1) & USART_CR1_RXNEIE) != 0) &&
|
||||
|
||||
Reference in New Issue
Block a user