vport stm32

This commit is contained in:
2021-11-09 17:44:26 -05:00
parent 18064d4766
commit 90c2c73e40
2 changed files with 23 additions and 2 deletions

View File

@@ -2,10 +2,15 @@
#include "usb_device.h"
#include <stdbool.h>
#include "usbd_cdc_if.h"
#include <stdio.h>
#include <string.h>
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
uint8_t *data = "Hello World from USB CDC\n";
char saludo[]="Hola mundo";
uint8_t buffer[64];
char * buffer2[10];
int contador = 0;
uint8_t data_new =0;
int main(void)
@@ -19,10 +24,15 @@ int main(void)
while (1)
{
if(data_new == 1){
CDC_Transmit_FS(buffer, 64);
CDC_Transmit_FS(buffer, strlen((char *)buffer));
data_new = 0;
}
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);
}
}

View 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