vport stm32
This commit is contained in:
@@ -2,10 +2,15 @@
|
|||||||
#include "usb_device.h"
|
#include "usb_device.h"
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "usbd_cdc_if.h"
|
#include "usbd_cdc_if.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
void SystemClock_Config(void);
|
void SystemClock_Config(void);
|
||||||
static void MX_GPIO_Init(void);
|
static void MX_GPIO_Init(void);
|
||||||
uint8_t *data = "Hello World from USB CDC\n";
|
uint8_t *data = "Hello World from USB CDC\n";
|
||||||
|
char saludo[]="Hola mundo";
|
||||||
uint8_t buffer[64];
|
uint8_t buffer[64];
|
||||||
|
char * buffer2[10];
|
||||||
|
int contador = 0;
|
||||||
uint8_t data_new =0;
|
uint8_t data_new =0;
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
@@ -19,10 +24,15 @@ int main(void)
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if(data_new == 1){
|
if(data_new == 1){
|
||||||
CDC_Transmit_FS(buffer, 64);
|
CDC_Transmit_FS(buffer, strlen((char *)buffer));
|
||||||
data_new = 0;
|
data_new = 0;
|
||||||
}
|
}
|
||||||
HAL_Delay (100);
|
itoa(contador,buffer2,10);
|
||||||
|
contador = contador +2;
|
||||||
|
CDC_Transmit_FS(buffer2, strlen((char *)buffer2));
|
||||||
|
HAL_Delay(100);
|
||||||
|
CDC_Transmit_FS("\n",1);
|
||||||
|
HAL_Delay (900);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
11
STM32/STM32CUBE/USB_VIRTUAL_PORT/test/README
Normal file
11
STM32/STM32CUBE/USB_VIRTUAL_PORT/test/README
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
This directory is intended for PlatformIO Unit Testing and project tests.
|
||||||
|
|
||||||
|
Unit Testing is a software testing method by which individual units of
|
||||||
|
source code, sets of one or more MCU program modules together with associated
|
||||||
|
control data, usage procedures, and operating procedures, are tested to
|
||||||
|
determine whether they are fit for use. Unit testing finds problems early
|
||||||
|
in the development cycle.
|
||||||
|
|
||||||
|
More information about PlatformIO Unit Testing:
|
||||||
|
- https://docs.platformio.org/page/plus/unit-testing.html
|
||||||
Reference in New Issue
Block a user