Skip to content

Commit

Permalink
Merge branch 'electro-smith:master' into dma_region_cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
GregBurns authored Mar 8, 2024
2 parents 26121bf + f7727ed commit 40d3f63
Show file tree
Hide file tree
Showing 25 changed files with 1,158 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build Documentation
uses: mattnotmitt/doxygen-action@v1.2.1
uses: mattnotmitt/doxygen-action@v1
with:
doxyfile-path: doc/Doxyfile

4 changes: 2 additions & 2 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build Documentation
uses: mattnotmitt/doxygen-action@v1.2.1
uses: mattnotmitt/doxygen-action@v1
with:
doxyfile-path: doc/Doxyfile
- name: Deploy Web
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.11
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.17
with:
source: 'src'
extensions: 'h,cpp'
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/test_results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Results

on:
workflow_run:
workflows: ["Unit Tests"]
types:
- completed
permissions: {}

jobs:
test-results:
name: Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
checks: write

# needed unless run with comment_mode: off
pull-requests: write

# required by download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
21 changes: 15 additions & 6 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -34,11 +34,20 @@ jobs:
cd tests/build/bin
./libDaisy_gtest --gtest_output=xml:gtestresults.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
files: tests/build/bin/**/*.xml
github_token: ${{ secrets.GITHUB_TOKEN }}

name: Test Results
path: tests/build/bin/**/*.xml

event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}

1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ target_include_directories(${TARGET} PUBLIC
Middlewares/Patched/ST/STM32_USB_Device_Library/Class/CDC/Inc
Middlewares/ST/STM32_USB_Host_Library/Core/Inc
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc
Middlewares/ST/STM32_USB_Host_Library/Class/MIDI/Inc
Middlewares/Third_Party/FatFs/src
src
src/sys
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Middlewares/Third_Party/FatFs/src/ff_gen_drv.c \
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c \
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_scsi.c \
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c \
Middlewares/ST/STM32_USB_Host_Library/Class/MIDI/Src/usbh_midi.c \
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c \
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c \
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c \
Expand Down Expand Up @@ -297,7 +298,6 @@ C_DEFS = \
-DDATA_IN_D2_SRAM
# ^ added for easy startup access


C_INCLUDES = \
-I$(MODULE_DIR) \
-I$(MODULE_DIR)/sys \
Expand All @@ -311,6 +311,7 @@ C_INCLUDES = \
-IMiddlewares/Patched/ST/STM32_USB_Device_Library/Class/CDC/Inc \
-IMiddlewares/ST/STM32_USB_Host_Library/Core/Inc \
-IMiddlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc \
-IMiddlewares/ST/STM32_USB_Host_Library/Class/MIDI/Inc \
-IMiddlewares/Third_Party/FatFs/src \
-I$(MODULE_DIR) \
-I.
Expand Down
87 changes: 87 additions & 0 deletions Middlewares/ST/STM32_USB_Host_Library/Class/MIDI/Inc/usbh_midi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/**
******************************************************************************
* @file usbh_midi.h
* @author Greg Burns
* @author MCD Application Team
* @brief This file contains all the prototypes for the usbh_midi.c
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2015 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/

/* Define to prevent recursive ----------------------------------------------*/
#ifndef __USBH_MIDI_H
#define __USBH_MIDI_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "usbh_core.h"

typedef enum {
MIDI_INIT = 0,
MIDI_IDLE,
MIDI_RX,
MIDI_RX_POLL,
MIDI_RX_ERROR,
MIDI_FATAL_ERROR
} MIDI_StateTypeDef;

typedef enum {
MIDI_OK,
MIDI_BUSY,
MIDI_ERROR
} MIDI_ErrorTypeDef;

typedef void (*USBH_MIDI_RxCallback)(uint8_t* buff, size_t len, void* pUser);

#define USBH_MIDI_RX_BUF_SIZE 64

/* Structure for MIDI process */
typedef struct _MIDI_Process {
uint8_t InPipe;
uint8_t InEp;
uint16_t InEpSize;
uint8_t OutPipe;
uint8_t OutEp;
uint16_t OutEpSize;
MIDI_StateTypeDef state;
MIDI_ErrorTypeDef error;
USBH_MIDI_RxCallback callback;
void* pUser;
uint8_t rxBuffer[USBH_MIDI_RX_BUF_SIZE];
} MIDI_HandleTypeDef;

/* MIDI Class Codes */
#define USB_AUDIO_CLASS 0x01U
#define USB_MIDI_STREAMING_SUBCLASS 0x03U

extern USBH_ClassTypeDef USBH_midi;
#define USBH_MIDI_CLASS &USBH_midi

uint8_t USBH_MIDI_IsReady(USBH_HandleTypeDef *phost);

MIDI_ErrorTypeDef USBH_MIDI_Transmit(USBH_HandleTypeDef *phost,
uint8_t* data, size_t len);

void USBH_MIDI_SetReceiveCallback(USBH_HandleTypeDef *phost,
USBH_MIDI_RxCallback cb, void* pUser);

#ifdef __cplusplus
}
#endif

#endif /* __USBH_MIDI_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Loading

0 comments on commit 40d3f63

Please sign in to comment.