Skip to content

Commit

Permalink
redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Nov 29, 2023
1 parent 5147554 commit c177b38
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 45 deletions.
37 changes: 0 additions & 37 deletions Marlin/src/HAL/STM32F1/HAL_N32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,43 +612,6 @@ void ADC_DMA_init() {
* n32g452 - end
==============================================================================*/

// ------------------------
// Serial ports
// ------------------------

// NOTE: The base HAL uses defined(SERIAL_USB) && !HAS_SD_HOST_DRIVE here
// Can this be changed to match?
#if defined(SERIAL_USB) && !defined(USE_USB_COMPOSITE)

USBSerial SerialUSB;
DefaultSerial1 MSerial0(true, SerialUSB);

#if ENABLED(EMERGENCY_PARSER)
#include "../libmaple/usb/stm32f1/usb_reg_map.h"
#include "libmaple/usb_cdcacm.h"
// The original callback is not called (no way to retrieve address).
// That callback detects a special STM32 reset sequence: this functionality is not essential
// as M997 achieves the same.
void my_rx_callback(unsigned int, void*) {
// max length of 16 is enough to contain all emergency commands
uint8 buf[16];

//rx is usbSerialPart.endpoints[2]
uint16 len = usb_get_ep_rx_count(USB_CDCACM_RX_ENDP);
uint32 total = usb_cdcacm_data_available();

if (len == 0 || total == 0 || !WITHIN(total, len, COUNT(buf)))
return;

// cannot get character by character due to bug in composite_cdcacm_peek_ex
len = usb_cdcacm_peek(buf, total);

for (uint32 i = 0; i < len; i++)
emergency_parser.update(MSerial0.emergency_state, buf[i + total - len]);
}
#endif
#endif

#define NS_PINRT(V...) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(V); }while(0)

// Init the AD in continuous capture mode
Expand Down
9 changes: 1 addition & 8 deletions Marlin/src/HAL/STM32F1/HAL_N32.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@

/**
* HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
* Specifically for VOXELAB_N32. TODO: Rework for generic N32 MCU.
* Specifically for VOXELAB_N32 (N32G452). TODO: Rework for generic N32 MCU.
*/

#include <STM32ADC.h>

/**=============================================================================
* n32g452
==============================================================================*/
typedef struct {
uint32_t WorkMode;
uint32_t MultiChEn;
Expand Down Expand Up @@ -893,7 +890,3 @@ void DMA_EnableChannel(DMA_ChannelType* DMAyChx, uint32_t Cmd);
* Initialize the DMA of ADC
================================================================*/
void ADC_DMA_init();

/**=============================================================================
* n32g452 - end
==============================================================================*/

0 comments on commit c177b38

Please sign in to comment.