Skip to content

Commit

Permalink
Added firmware for Electronic Cats hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
sabas1080 committed Aug 30, 2020
1 parent d23ac0e commit c13abd3
Show file tree
Hide file tree
Showing 11 changed files with 2,357 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ fp-info-cache
# Exported BOM files
*.xml
*.csv

.DS_Store

hardware/fp-lib-table

hardware/sym-lib-table

*.dcm
42 changes: 42 additions & 0 deletions firmware/CMSIS_DAP.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
CMSIS_DAP
Modified form ljbfly's implementation, working but a lot to improve
RST -> P30
SWCLK -> P31
SWDIO -> P32
These pins works in OC mode with pull-up resistor (70K). Should be safe to connect 3.3V part.
created 2020
by Deqing Sun for use with CH55xduino
This example code is in the public domain.
*/


#ifndef USER_USB_RAM
#error "This example needs to be compiled with a USER USB setting"
#endif

#include "src/CMSIS_DAPusb/DAP.h"


extern volatile __xdata uint8_t USBByteCountEP1;


void setup() {
USBInit();
}

void loop() {
if (USBByteCountEP1) {
DAP_Thread();
USBByteCountEP1 = 0 ;

UEP1_CTRL = UEP1_CTRL & ~ MASK_UEP_R_RES | UEP_R_RES_ACK; //enable receive

UEP1_T_LEN = 64;
UEP1_CTRL = UEP1_CTRL & ~ MASK_UEP_T_RES | UEP_T_RES_ACK; //enable send
}
}
Loading

0 comments on commit c13abd3

Please sign in to comment.