sync with development PC; old -> kicad8

This commit is contained in:
Edward Emelianov 2024-03-06 11:51:10 +03:00
parent c6e8347d23
commit 4a6086a182
8 changed files with 110929 additions and 68764 deletions

Binary file not shown.

View File

@ -35,7 +35,7 @@ static uint32_t maxCnum = 1024 / sizeof(user_conf); // can't use blocksize here
.userconf_sz = sizeof(user_conf) \
,.CANspeed = 100000 \
,.CANID = 0xaa \
,.bounce = 50 \
,.bounce_ms = 50 \
,.adcmul[0] = 10.930f \
,.adcmul[1] = 2.028f \
,.adcmul[2] = 1.f \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -67,11 +67,30 @@
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"git": {
"repo_password": "",
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "stm32.kicad_prl",
"version": 3
},
"project": {
"files": []
},
"schematic": {
"selection_filter": {
"graphics": true,
"images": true,
"labels": true,
"lockedItems": false,
"otherItems": true,
"pins": true,
"symbols": true,
"text": true,
"wires": true
}
}
}

View File

@ -204,6 +204,13 @@
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"ipc2581": {
"dist": "",
"distpn": "",
"internal_id": "",
"mfg": "",
"mpn": ""
},
"layer_presets": [],
"viewports": []
},
@ -398,10 +405,12 @@
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"footprint_link_issues": "warning",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"lib_symbol_mismatch": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
@ -496,14 +505,75 @@
"gencad": "",
"idf": "",
"netlist": "stm32.net",
"plot": "",
"pos_files": "",
"specctra_dsn": "",
"step": "",
"svg": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
}
],
"filter_string": "",
"group_symbols": true,
"name": "Grouped By Value",
"sort_asc": true,
"sort_field": "Reference"
},
"connection_grid_size": 50.0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
@ -517,6 +587,11 @@
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.25,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"pin_symbol_size": 0.0,
"text_offset_ratio": 0.08
},
@ -542,6 +617,7 @@
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_dissipations": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
@ -549,7 +625,7 @@
"sheets": [
[
"f40cbe7e-cd25-45e5-a6cb-d92457495048",
""
"Root"
],
[
"311a5cb3-0370-4a86-a5e8-6335fee47f9a",

File diff suppressed because it is too large Load Diff

View File

@ -1,123 +0,0 @@
/*
* This file is part of the canbus4bta project.
* Copyright 2023 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "adc.h"
#include "proto.h"
#include "strfunc.h"
#include "usart.h"
#include "usb.h"
#include "version.inc"
const char* helpmsg =
"https://github.com/eddyem/stm32samples/tree/master/F3:F303/CANbus4BTA build#" BUILD_NUMBER " @ " BUILD_DATE "\n"
"'a' - print ADC values\n"
"'i' - print USB->ISTR state\n"
"'p' - toggle USB pullup\n"
"'N' - read number (dec, 0xhex, 0oct, bbin) and show it in decimal\n"
"'R' - software reset\n"
"'T' - get MCU T\n"
"'U' - get USB status\n"
"'W' - test watchdog\n"
;
static char stbuf[256], *bptr = NULL;
static int blen = 0;
static void initbuf(){bptr = stbuf; blen = 255; *bptr = 0;}
static void bufputchar(char c){
if(blen == 0) return;
*bptr++ = c; --blen;
*bptr = 0;
}
static void add2buf(const char *s){
while(blen && *s){
*bptr++ = *s++;
--blen;
}
*bptr = 0;
}
extern uint8_t usbON;
const char *parse_cmd(const char *buf){
initbuf();
if(buf[1] == '\n' || !buf[1]){ // one symbol commands
switch(*buf){
case 'a':
for(int i = 0; i < ADC_TSENS; ++i){
bufputchar('A'); bufputchar(i+'0'); bufputchar('=');
add2buf(u2str(getADCval(i))); bufputchar('\n');
}
return stbuf;
break;
case 'i':
add2buf("USB->ISTR=");
add2buf(uhex2str(USB->ISTR));
add2buf(", USB->CNTR=");
add2buf(uhex2str(USB->CNTR));
break;
case 'p':
pin_toggle(USBPU_port, USBPU_pin);
add2buf("USB pullup is ");
if(pin_read(USBPU_port, USBPU_pin)) add2buf("off");
else add2buf("on");
break;
case 'R':
USB_sendstr("Soft reset\n");
NVIC_SystemReset();
break;
case 'T':
add2buf("T=");
add2buf(float2str(getMCUtemp(), 1));
break;
case 'U':
add2buf("USB status: ");
if(usbON) add2buf("ON");
else add2buf("OFF");
break;
case 'W':
USB_sendstr("Wait for reboot\n");
usart_send("Wait for reboot\n");
while(1){nop();};
break;
default:
return helpmsg;
}
bufputchar('\n');
return stbuf;
}
uint32_t Num = 0;
const char *nxt;
switch(*buf){ // long messages
case 'N':
++buf;
nxt = getnum(buf, &Num);
if(buf == nxt){
if(Num == 0) return "Wrong number\n";
return "Integer32 overflow\n";
}
add2buf("You give: ");
add2buf(u2str(Num));
if(*nxt && *nxt != '\n'){
add2buf(", the rest of string: ");
add2buf(nxt);
}else add2buf("\n");
break;
default:
return buf;
}
return stbuf;
}