Updated to the new locm3 changed to stdint types.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#include <libopencm3/stm32/f4/rcc.h>
|
||||
#include <libopencm3/stm32/f4/gpio.h>
|
||||
|
||||
u16 exti_line_state;
|
||||
uint16_t exti_line_state;
|
||||
|
||||
/* Set STM32 to 168 MHz. */
|
||||
static void clock_setup(void)
|
||||
|
||||
@@ -50,11 +50,11 @@ static void gpio_setup(void)
|
||||
}
|
||||
|
||||
/* Tried to folow the guidelines in the stm32f4 user manual.*/
|
||||
static u32 random_int(void)
|
||||
static uint32_t random_int(void)
|
||||
{
|
||||
static u32 last_value=0;
|
||||
static u32 new_value=0;
|
||||
u32 error_bits = 0;
|
||||
static uint32_t last_value=0;
|
||||
static uint32_t new_value=0;
|
||||
uint32_t error_bits = 0;
|
||||
error_bits = RNG_SR_SEIS | RNG_SR_CEIS;
|
||||
while (new_value==last_value) {
|
||||
/* Check for error flags and if data is ready. */
|
||||
@@ -73,7 +73,7 @@ int main(void)
|
||||
gpio_setup();
|
||||
rng_setup();
|
||||
while(1){
|
||||
u32 rnd;
|
||||
uint32_t rnd;
|
||||
rnd = random_int();
|
||||
for(i=0;i!=32;++i){
|
||||
if ( (rnd & (1 << i))!=0 )
|
||||
|
||||
@@ -86,7 +86,7 @@ int main(void)
|
||||
|
||||
void usart2_isr(void)
|
||||
{
|
||||
static u8 data = 'A';
|
||||
static uint8_t data = 'A';
|
||||
|
||||
/* Check if we were called because of RXNE. */
|
||||
if (((USART_CR1(USART2) & USART_CR1_RXNEIE) != 0) &&
|
||||
|
||||
@@ -165,10 +165,10 @@ static const char *usb_strings[] = {
|
||||
};
|
||||
|
||||
/* Buffer to be used for control requests. */
|
||||
u8 usbd_control_buffer[128];
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, u8 **buf,
|
||||
u16 *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
(void)complete;
|
||||
(void)buf;
|
||||
@@ -192,7 +192,7 @@ static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, u8 ep)
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
{
|
||||
(void)ep;
|
||||
|
||||
@@ -207,7 +207,7 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, u8 ep)
|
||||
gpio_toggle(GPIOC, GPIO5);
|
||||
}
|
||||
|
||||
static void cdcacm_set_config(usbd_device *usbd_dev, u16 wValue)
|
||||
static void cdcacm_set_config(usbd_device *usbd_dev, uint16_t wValue)
|
||||
{
|
||||
(void)wValue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user