Programming/C Win32 MFC2022. 8. 29. 11:43

무슨 마법인진 모르겠다.

아무튼.. for  문으로 32bit를 뒤집으려면

최소한 비트 * 5 이상의 연산이 필요할텐데(쉬프트, and , or, for문 비교, for문 증가)

 

[링크 : https://stackoverflow.com/questions/746171/efficient-algorithm-for-bit-reversal-from-msb-lsb-to-lsb-msb-in-c]

'Programming > C Win32 MFC' 카테고리의 다른 글

free(): invalid next size (normal)  (0) 2023.12.18
c에서 cpp 함수 불러오기  (0) 2023.01.04
kore - c restful api server  (0) 2022.07.07
fopen exclusivly  (0) 2021.07.09
vs2019 sdi , mdi 프로젝트 생성하기  (0) 2021.07.08
Posted by 구차니

위중증은 늘어나는 느낌인데 확진자는 줄어든다..

그렇다면 치명율이 높아져 전염율이 떨어질 정도라는 걸까

아니면 확진자 수를 줄이기 위해 검사를 하지 않는 걸까?

 

 

위중증 환자 600명 육박, 확진자 5만명 밑으로

[링크 : https://v.daum.net/v/20220829103600936]

Posted by 구차니
embeded/Cortex-M3 STM2022. 8. 29. 10:37

STM32F는 이렇게 단순한데

 

검색한 내용중에 H와 G 시리즈가 걸려 나와서

STM32G로 검색해서 가장 위에 있던 STM32G030C6Tx로

프로젝트 구성해보니 내용이 많이 나온다. 눈에 띄는건.. MSB First 라는 항목

 

main.c는 아래와 같이 생성되었고

  /* USER CODE END USART1_Init 1 */
  huart1.Instance = USART1;
  huart1.Init.BaudRate = 115200;
  huart1.Init.WordLength = UART_WORDLENGTH_8B;
  huart1.Init.StopBits = UART_STOPBITS_1;
  huart1.Init.Parity = UART_PARITY_NONE;
  huart1.Init.Mode = UART_MODE_TX_RX;
  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
  huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
  huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
  huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_DMADISABLEONERROR_INIT|UART_ADVFEATURE_MSBFIRST_INIT;
  huart1.AdvancedInit.DMADisableonRxError = UART_ADVFEATURE_DMA_DISABLEONRXERROR;
  huart1.AdvancedInit.MSBFirst = UART_ADVFEATURE_MSBFIRST_ENABLE;

 

Stm32g0xx_hal_uart.h를 따라가면 아래와 같이 먼가 있긴 하다.(귀찮아..)

#define UART_ADVFEATURE_NO_INIT                 0x00000000U          /*!< No advanced feature initialization       */
#define UART_ADVFEATURE_TXINVERT_INIT           0x00000001U          /*!< TX pin active level inversion            */
#define UART_ADVFEATURE_RXINVERT_INIT           0x00000002U          /*!< RX pin active level inversion            */
#define UART_ADVFEATURE_DATAINVERT_INIT         0x00000004U          /*!< Binary data inversion                    */
#define UART_ADVFEATURE_SWAP_INIT               0x00000008U          /*!< TX/RX pins swap                          */
#define UART_ADVFEATURE_RXOVERRUNDISABLE_INIT   0x00000010U          /*!< RX overrun disable                       */
#define UART_ADVFEATURE_DMADISABLEONERROR_INIT  0x00000020U          /*!< DMA disable on Reception Error           */
#define UART_ADVFEATURE_AUTOBAUDRATE_INIT       0x00000040U          /*!< Auto Baud rate detection initialization  */
#define UART_ADVFEATURE_MSBFIRST_INIT           0x00000080U          /*!< Most significant bit sent/received first */


#define USART_CR2_MSBFIRST_Pos       (19U)
#define USART_CR2_MSBFIRST_Msk       (0x1UL << USART_CR2_MSBFIRST_Pos)         /*!< 0x00080000 */
#define USART_CR2_MSBFIRST           USART_CR2_MSBFIRST_Msk                    /*!< Most Significant Bit First */


#define UART_ADVFEATURE_MSBFIRST_DISABLE    0x00000000U             /*!< Most significant bit sent/received
                                                                         first disable                      */
#define UART_ADVFEATURE_MSBFIRST_ENABLE     USART_CR2_MSBFIRST      /*!< Most significant bit sent/received
                                                                         first enable                       */

 

The USART can also communicate synchronously. It can operate as a SPI in Master or Slave mode with programmable clock polarity (CPOL) and phase (CPHA) and programmable data order with MSB or LSB first. The clock is output (in case of Master mode) or input (in case of Slave mode) on the CK pin. No clock pulses are provided during the start and stop bits. When the USART is configured in SPI slave mode, it supports the Transmit underrun error and the NSS hardware or software management.

[링크 : https://www.st.com/.../en.STM32G0-Peripheral-USART-interface-USART.pdf]

[링크 : https://www.st.com/.../en.STM32H7-Peripheral-USART_interface_USART.pdf]

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32 reset 없이 JTAG 붙이기  (0) 2023.07.19
stm32 wdg 최대 설정시간  (0) 2021.08.09
stm32 RST pull-up reset fail  (0) 2021.08.02
STM32 RDP(ReaD Protection)  (0) 2021.07.02
stm32 uart echo  (0) 2021.02.04
Posted by 구차니
Apple2022. 8. 27. 22:38

어찌된 게 찾아봐도..

크램쉘 모드라고 하는 USB 키보드,마우스,트랙패드 달고 화면만 쓰지 않는 모드만 나오고

윈도우나 리눅스 처럼 키보드 트랙패드는 노트북 본체의 것을 사용하고 화면만 외부 모니터를 메인으로 사용하는 건 존재하지 않는 듯.

이런 이상한 사용 시나리오는 애플에서 허용할 수 없는 건가?

 

[링크 : https://apple.stackexchange.com/questions/269853/]

'Apple' 카테고리의 다른 글

애플 무선 키보드 주웠다 버림  (0) 2024.01.01
맥북 초기화 하기  (0) 2022.12.27
macos catalina iso 파일  (0) 2022.06.23
macos iso  (0) 2022.06.20
맥 화면 90도 돌리기  (0) 2022.06.18
Posted by 구차니
embeded/ARM2022. 8. 26. 18:25

왜 찾게 되었냐면.. 알고 싶지 않았습니다.. -_-

[링크 : https://stackoverflow.com/questions/20436466/lsb-to-msb-bit-reversal-on-arm]

 

RBIT
Reverse the bit order in a 32-bit word.

Syntax
RBIT{cond} Rd, Rn

[링크 : https://developer.arm.com/documentation/dui0473/m/arm-and-thumb-instructions/rbit]

 

REV
Reverse the byte order in a word.

Syntax
REV{cond} Rd, Rnn

[링크 : https://developer.arm.com/documentation/dui0473/m/arm-and-thumb-instructions/rev]

'embeded > ARM' 카테고리의 다른 글

i.mx8m plus arm trust zone  (0) 2023.02.24
ampere altra / 기가바이트 R272-P30 / 우분투  (0) 2023.02.03
vfp, neon cycle  (0) 2022.01.23
cortex-a9 neon  (0) 2021.06.21
EIM (external interface module)  (0) 2021.06.21
Posted by 구차니
모종의 음모/HDLC2022. 8. 26. 15:47

아.. 이런 변수가 하나 더 있었던 건가..

111111 가 전송되려면 1111101 이런식으로 전송되어야 한다.

(그런데.. 진짜 데이터가 111110 이면 어떡해야 하지? 어짜피 5개가 되었으니 1111100이 되는건가?)

Because a flag sequence consists of six consecutive 1-bits, other data is coded to ensure that it never contains more than five 1-bits in a row. This is done by bit stuffing: any time that five consecutive 1-bits appear in the transmitted data, the data is paused and a 0-bit is transmitted.

HDLC transmits bytes of data with the least significant bit first (not to be confused with little-endian order, which refers to byte ordering within a multi-byte field).

[링크 : https://en.wikipedia.org/wiki/High-Level_Data_Link_Control]

 

The NRZI coding scheme transmits a 0 bit as a signal transition, and a 1 bit as no change. In this case, bit stuffing is most easily described as the insertion of a 0 bit after a long run of 1 bits.

[링크 : https://en.wikipedia.org/wiki/Bit_stuffing]

 

[링크 : https://copycode.tistory.com/79]

[링크 : https://itwiki.kr/w/HDLC]

[링크 : https://goodgid.github.io/What-is-HDLC/]

 

+

 

 

0,1 눈대중으로 변환해서 연속된 0이나 1에 대한 오류가 존재하지만

전반적으로 비트가 뒤집힌 형태로 전송됨을 확인함. (바이트 내에서 LSB가 MSB에 존재함)

7E 11 22 33 1E 0A 7F
01111110 00010001 00100010 00110011 00011110 00001010 01111111 (raw)
01111110 10110100 10010110 10001000 10111110 10100110 01111111 (nrzi)

11111110 01011010 11010010 00100010 11111010 11001010 11111110 (수신데이터)
01111111 01011010 01001011 01000100 01011111 01010011 01111111 (수신데이터 바이트 단위 순서 변경)

 

'모종의 음모 > HDLC' 카테고리의 다른 글

HDLC bit stuff  (0) 2022.08.29
hdlc nrzi encoder / decoder (bit stuff 제외)  (0) 2022.08.29
HDLC FCS ccitt-1 16bit crc  (0) 2021.12.06
HDLC 프로토콜(High level Data Link Control)  (0) 2021.07.27
Posted by 구차니
파일방2022. 8. 26. 14:04

쥬라기 공원 기억이 잘 안나서.. 동영상을 찾아보는데 여전히 기억이 안난다(!)

[링크 : https://en.wikipedia.org/wiki/Fsn_(file_manager)]

 

아무튼 SGI 웍스에서 3d 파일 탐색기로 제공되던 녀석의 요즘(?) 버전이 fsv

[링크 : https://www.reddit.com/r/ManjaroLinux/comments/byqttv/is_it_possible_to_install_the_fsnfusion_file/]

[링크  : https://www.youtube.com/watch?v=bo3G0xJSqJs]

[링크  : http://fsv.sourceforge.net/]

'파일방' 카테고리의 다른 글

kchmviewer  (0) 2023.06.14
barrier - fork of synergy  (0) 2023.01.02
tsdb influxdb  (0) 2022.07.05
rufus - symbol 'grub_register_command_lockdown' not found  (0) 2022.06.27
codesys  (0) 2022.05.18
Posted by 구차니
개소리 왈왈/블로그2022. 8. 26. 10:55

이제 이메일/다음 계정을 카카오로 강제 통합 -_-

'개소리 왈왈 > 블로그' 카테고리의 다른 글

티스토리 복구는 개뿔  (0) 2022.10.17
티스토리 드뎌 복구  (2) 2022.10.16
해피빈 기부  (0) 2022.08.22
티스토리 레이아웃 왕창 깨지네  (0) 2022.08.08
근 한달만의 블로그 정리  (2) 2022.07.21
Posted by 구차니
프로그램 사용/minicom2022. 8. 25. 11:36

-H를 주면 hex mode로 출력되는데 작동중에 모드 전환하는건 없나?

 

$ minicom --help
Usage: minicom [OPTION]... [configuration]
A terminal program for Linux and other unix-like systems.

  -b, --baudrate         : set baudrate (ignore the value from config)
  -D, --device           : set device name (ignore the value from config)
  -s, --setup            : enter setup mode
  -o, --noinit           : do not initialize modem & lockfiles at startup
  -m, --metakey          : use meta or alt key for commands
  -M, --metakey8         : use 8bit meta key for commands
  -l, --ansi             : literal; assume screen uses non IBM-PC character set
  -L, --iso              : don't assume screen uses ISO8859
  -w, --wrap             : Linewrap on
  -H, --displayhex       : display output in hex
  -z, --statline         : try to use terminal's status line
  -7, --7bit             : force 7bit mode
  -8, --8bit             : force 8bit mode
  -c, --color=on/off     : ANSI style color usage on or off
  -a, --attrib=on/off    : use reverse or highlight attributes on or off
  -t, --term=TERM        : override TERM environment variable
  -S, --script=SCRIPT    : run SCRIPT at startup
  -d, --dial=ENTRY       : dial ENTRY from the dialing directory
  -p, --ptty=TTYP        : connect to pseudo terminal
  -C, --capturefile=FILE : start capturing to FILE
  -F, --statlinefmt      : format of status line
  -R, --remotecharset    : character set of communication partner
  -v, --version          : output version information and exit
  -h, --help             : show help
  configuration          : configuration file to use

These options can also be specified in the MINICOM environment variable.
This variable is currently unset.
The configuration directory for the access file and the configurations
is compiled to /etc/minicom.

Report bugs to <minicom-devel@lists.alioth.debian.org>.

 

-H, --displayhex
Turn on output in hex mode.

[링크 : https://www.systutorials.com/docs/linux/man/1-minicom/]

'프로그램 사용 > minicom' 카테고리의 다른 글

minicom lf에 cr 붙이기  (0) 2023.01.05
minicom 로그 저장하기  (0) 2021.09.16
minicom timestamp  (0) 2021.09.16
minicom 폭 늘리기  (0) 2021.01.28
/dev/tty 를 sudo 쓰지 않고 사용하기  (0) 2020.09.24
Posted by 구차니
Programming/web 관련2022. 8. 24. 18:05

음.. 환상이 컸었나..

지금 다시 보는데 POST로 id, pw를 plain text로 보내는 센스..

서버가 https로 보안채널이 되었다고 가정하지 않으면 의미없는 짓 같은 느낌..

 

[링크 : https://llshl.tistory.com/28]

[링크 : https://minho-jang.github.io/development/7/]

[링크 : https://velopert.com/2389]

 

SSO 구현에 JWT가 가능한진 좀 찾아봐야겠다.

[링크 : https://brunch.co.kr/@sangjinkang/36]

'Programming > web 관련' 카테고리의 다른 글

chart.js 특정 항목 보이지 않게 하기(가로줄 치기)  (0) 2023.03.10
chart.js 수직 도움선  (0) 2023.01.27
quirks mode  (0) 2022.08.08
grid와 flex  (0) 2022.07.04
markdown 문법 - 체크박스  (0) 2020.10.15
Posted by 구차니