mirror of
https://github.com/eddyem/stm32samples.git
synced 2025-12-06 10:45:11 +03:00
Modified VID/PID for working in mustdie
This commit is contained in:
parent
20e9313664
commit
5c9cf855af
@ -19,7 +19,7 @@ To get precision time this tool use GPS module (NEO-6M)
|
||||
|
||||
#### Connection diagram
|
||||
| Pin | Function |
|
||||
| :-: |:-|
|
||||
| :--: | :-------- |
|
||||
| PA0 | Infrared sensor data |
|
||||
| PA1 | Laser photoresistor data |
|
||||
| PA2 | GPS Rx (MCU Tx) |
|
||||
|
||||
@ -64,7 +64,7 @@ int main(void){
|
||||
rcc_clock_setup_in_hse_8mhz_out_72mhz();
|
||||
// init systick (1ms)
|
||||
systick_set_clocksource(STK_CSR_CLKSOURCE_AHB_DIV8); // Systyck: 72/8=9MHz
|
||||
systick_set_reload(8999); // 9000 pulses: 1kHz
|
||||
systick_set_reload(STK_RVR_DEFAULT_VAL); // 9000 pulses: 1kHz
|
||||
systick_interrupt_enable();
|
||||
systick_counter_enable();
|
||||
|
||||
@ -98,7 +98,7 @@ int main(void){
|
||||
GPS_parse_answer(string);
|
||||
}
|
||||
if(trigger_ms != DIDNT_TRIGGERED && trigger_ms != Timer){
|
||||
if(msctr - trigrtm > 500 || trigrtm > msctr){
|
||||
if(msctr - trigrtm > TRIGGER_DEBOUNCE_DELAY || trigrtm > msctr){
|
||||
trigrtm = msctr;
|
||||
P("Trigger time: ");
|
||||
print_time(&trigger_time, trigger_ms);
|
||||
@ -107,7 +107,7 @@ int main(void){
|
||||
}
|
||||
for(i = 0; i < ADC_CHANNEL_NUMBER; ++i){
|
||||
if(adc_ms[i] != DIDNT_TRIGGERED && adc_ms[i] != Timer){
|
||||
if(msctr - adctm[i] > 500 || adctm[i] > msctr){
|
||||
if(msctr - adctm[i] > ADC_DEBOUNCE_DELAY || adctm[i] > msctr){
|
||||
adctm[i] = msctr;
|
||||
P("ADC");
|
||||
put_char_to_buf('0'+i);
|
||||
@ -125,7 +125,7 @@ int main(void){
|
||||
}
|
||||
}
|
||||
if(ultrasonic_ms != DIDNT_TRIGGERED && ultrasonic_ms != Timer){
|
||||
if(msctr - ultrasonictm > 500 || ultrasonictm > msctr){
|
||||
if(msctr - ultrasonictm > ULTRASONIC_DEBOUNCE_DELAY || ultrasonictm > msctr){
|
||||
ultrasonictm = msctr;
|
||||
P("Ultrasonic time: ");
|
||||
print_time(&ultrasonic_time, ultrasonic_ms);
|
||||
|
||||
@ -50,6 +50,14 @@ extern void *memcpy(void *dest, const void *src, int n);
|
||||
|
||||
#define DIDNT_TRIGGERED (2000)
|
||||
|
||||
// debounce delays:
|
||||
// Trigger (button) - 500ms
|
||||
#define TRIGGER_DEBOUNCE_DELAY (500)
|
||||
// ADC debounce - 1000ms
|
||||
#define ADC_DEBOUNCE_DELAY (1000)
|
||||
// ultrasonic - 1500ms
|
||||
#define ULTRASONIC_DEBOUNCE_DELAY (1500)
|
||||
|
||||
typedef struct{
|
||||
uint8_t H;
|
||||
uint8_t M;
|
||||
|
||||
Binary file not shown.
@ -37,9 +37,9 @@ const struct usb_device_descriptor dev = {
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = 64,
|
||||
// 0x03EB 0x2042 - Atmel Keyboard Demo Application
|
||||
.idVendor = 0x03EB,
|
||||
.idProduct = 0x2042,
|
||||
// 0x045E 0x005C - Microsoft Office Keyboard (106/109)
|
||||
.idVendor = 0x045E,
|
||||
.idProduct = 0x005C,
|
||||
.bcdDevice = 0x0200,
|
||||
.iManufacturer = 1,
|
||||
.iProduct = 2,
|
||||
@ -154,7 +154,7 @@ const struct usb_config_descriptor config = {
|
||||
};
|
||||
|
||||
static const char *usb_strings[] = {
|
||||
"Simple matrix keyboard 3x4",
|
||||
"Timelapse keyboard",
|
||||
"EEV",
|
||||
"v01",
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user