diff options
-rw-r--r-- | center_fw/.gdbinit | 6 | ||||
-rw-r--r-- | driver/driver.kicad_pro | 7 | ||||
-rw-r--r-- | driver_fw/.gdbinit | 18 | ||||
-rw-r--r-- | driver_fw/src/main.c | 35 |
4 files changed, 51 insertions, 15 deletions
diff --git a/center_fw/.gdbinit b/center_fw/.gdbinit index 766b39d..0a93b51 100644 --- a/center_fw/.gdbinit +++ b/center_fw/.gdbinit @@ -1,5 +1,5 @@ -target extended-remote 192.168.1.97:2022 +target extended-remote 192.168.27.119:2022 set print pretty on set print elements 512 @@ -29,7 +29,3 @@ define jdump end end -define reconnect - disconnect - target extended-remote 192.168.1.97:2022 -end diff --git a/driver/driver.kicad_pro b/driver/driver.kicad_pro index f58a869..4c2a585 100644 --- a/driver/driver.kicad_pro +++ b/driver/driver.kicad_pro @@ -273,6 +273,13 @@ ], "zones_allow_external_fillets": false }, + "ipc2581": { + "dist": "", + "distpn": "", + "internal_id": "", + "mfg": "", + "mpn": "" + }, "layer_presets": [], "viewports": [] }, diff --git a/driver_fw/.gdbinit b/driver_fw/.gdbinit index a8b0d69..652efda 100644 --- a/driver_fw/.gdbinit +++ b/driver_fw/.gdbinit @@ -1,5 +1,16 @@ -target extended-remote 192.168.1.95:2022 +# blackmagic-1 +# target extended-remote 192.168.27.252:2022 + +# blackmagic-2 +# target extended-remote 192.168.27.114:2022 + +# blackmagic-3 +# target extended-remote 192.168.27.207:2022 + +# blackmagic-4 +target extended-remote 192.168.27.153:2022 + set print pretty on set print elements 512 @@ -18,8 +29,3 @@ end source ~/ref/PyCortexMDebug/cmdebug/svd_gdb.py svd_load ~/ref/stm32square/svd/STM32G070.svd -define reconnect - disconnect - target extended-remote 192.168.1.95:2022 -end - diff --git a/driver_fw/src/main.c b/driver_fw/src/main.c index d5b0e83..ba3ddb8 100644 --- a/driver_fw/src/main.c +++ b/driver_fw/src/main.c @@ -37,6 +37,8 @@ static bool idle_buf_ready = false; void update_tx_buf(void); +char usartbuf[256]; +int usartp = 0; int main(void) { /* Configure clocks for 64 MHz system clock. @@ -158,6 +160,8 @@ int main(void) { GPIOD->MODER = IN(0) | IN(1) | IN(2) | IN(3) | IN(4) | IN(5) | IN(6) | IN(8) | IN(9); + delay_us(5*1000*1000); + TIM1->CCMR1 = (6<<TIM_CCMR1_OC2M_Pos) | TIM_CCMR1_OC2PE; TIM1->CCMR2 = (6<<TIM_CCMR2_OC3M_Pos) | TIM_CCMR2_OC3PE; TIM1->CCER = TIM_CCER_CC2E | TIM_CCER_CC2NE | TIM_CCER_CC2NP | TIM_CCER_CC3E | TIM_CCER_CC3NE | TIM_CCER_CC3P; @@ -177,21 +181,44 @@ int main(void) { dma_tx_constant(COUNT_OF(waveform_zero_one), 0x00); xfr_8b10b_encode_reset(&encoder_state_8b10b); + USART1->CR1 = /* 8-bit -> M1, M0 clear */ + /* OVER8 clear. Use default 16x oversampling */ + /* CMIF clear */ + /* MME clear */ + /* WAKE clear */ + /* PCE, PS clear */ + /* RXNEIE, other interrupts clear */ + USART_CR1_TE + | USART_CR1_RE; + USART1->CR3 |= USART_CR3_DEM; /* Output DE signal on RTS pin */ + USART1->BRR = 6667; /* Set baudrate to 9600 Bd */ + USART1->CR1 |= USART_CR1_UE; /* And... go! */ + int i = 0; int j = 0; int k = 0; int n = 0; while (23) { + if (USART1->ISR & USART_ISR_RXNE_RXFNE) { + usartbuf[usartp] = USART1->RDR; + usartp ++; + if (usartp >= sizeof(usartbuf)) { + usartp = 0; + } + } + } + + { i++; j++; i %= 6; j %= 4; - delay_us(30000); + delay_us(100000); set_rj45_leds(1 << j); - set_status_leds(1 << i); + set_status_leds(0x01); if (i == 0) { k++; - if (k == 16) { + if (k == 10) { k = 0; n++; if (n == 16) { @@ -203,7 +230,7 @@ int main(void) { memset(tx_buf_write, 0, sizeof(*tx_buf_write)); for (size_t i=0; i<COUNT_OF(tx_buf_write->packet.channels); i++) { - tx_buf_write->packet.channels[i] = 0xff; + tx_buf_write->packet.channels[i] = (k < 9) ? (1<<k) : 0xff; } for (size_t i=0; i<COUNT_OF(tx_buf_write->packet.brightness); i++) { tx_buf_write->packet.brightness[i] = 0xff; //(n<<4) | n; |