<div><br /></div> <div><br /></div> <div>소스에 대해 질문하고 싶지만 컴파일러처럼 하이라이트 표시를 안해주니 </div> <div>보는 사람이 분석하기가 힘들잖아요</div> <div><br /></div> <div>그래서 소스를 하이라이트 해줘서 html로 변환해주는 사이트가 상~당히 많은데 </div> <div>대부분 오유 편집기에서는 이상동작을 하더라고요? </div> <div><br /></div> <div><span style="font-size: 9pt; line-height: 1.5">그래서 요기 사이트 가서 변환을 해보니 잘 되긴 합니다.</span></div> <div><span style="font-size: 9pt; line-height: 1.5"><a target="_blank" href="http://puzzleware.net/CodeHtmler/default.aspx" target="_blank">http://puzzleware.net/CodeHtmler/default.aspx</a></span></div> <div><br /></div> <div>변환하실 때 <span style="font-family: Gulim; line-height: normal"><font size="2">Whitespace Options가 </font></span></div> <div><span style="font-family: Gulim; line-height: normal"><font size="2">"Use </font><pre><font size="2"> Tag"로 되어있을텐데 "Converter Whitespace"로 선택해주세요.</font></pre></span></div> <div><span style="font-family: Gulim; line-height: normal"><font size="2"><br /></font></span></div> <div><span style="font-family: Gulim; line-height: normal"><font size="2">그리고 변환결과가 두가지가 나오는데 </font></span></div> <div><span style="font-family: Gulim; line-height: normal"><font size="2">위에는 하이라이트가 적용된 소스코드고</font></span></div> <div><font face="Gulim" size="2"><span style="line-height: normal">밑에는 html코드인데</span></font></div> <div><font face="Gulim" size="2"><span style="line-height: normal"><br /></span></font></div> <div><font face="Gulim" size="2"><span style="line-height: normal">위에꺼 그냥 복사해서 오유 편집기에 붙여넣기 하시면 됩니다.</span></font></div> <div><font face="Gulim" size="2"><span style="line-height: normal"><br /></span></font></div> <div><font face="Gulim" size="2"><span style="line-height: normal">그럼 다음과 같이 하이라이트 처리가 된 소스를 올릴 수 있지요.</span></font></div> <div><br /></div> <div><br /></div> <div><br /></div> <div><font size="2"><span style="font-family: 'Courier New'; line-height: normal; color: green">// MAIN</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal; color: blue">void</span><span style="font-family: 'Courier New'; line-height: normal"> main(</span><span style="font-family: 'Courier New'; line-height: normal; color: blue">void</span><span style="font-family: 'Courier New'; line-height: normal">) </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal">{ </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// Application에서 쓰이는 Digital Input/Output용 GPIO 포트 초기화</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> app_gpio_init(); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// SPI 초기화</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> DF_Init(); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// 환경설정 읽기</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> ReadEnvironment(); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// Read dip-sw </span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> can_bps_index = get_can_bps_info(); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// Capture 핀 사용하지 않을 경우 입력으로 설정함</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> PORTB_PCR0 = PORT_PCR_MUX(</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">1</span><span style="font-family: 'Courier New'; line-height: normal">); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> PORTB_PCR18 = PORT_PCR_MUX(</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">1</span><span style="font-family: 'Courier New'; line-height: normal">); </span><br style="font-family: 'Courier New'; line-height: normal" /><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// FlexCAN 주변장치 초기화</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> can0_init(can_bps_index); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> can1_init(can_bps_index); </span><br style="font-family: 'Courier New'; line-height: normal" /><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// 시리얼 통신 초기화</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> Serial_init(); </span><br style="font-family: 'Courier New'; line-height: normal" /><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// ARM Core System Tick Timer를 10ms 주기로 초기화</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> enable_system_tick_timer(</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">10</span><span style="font-family: 'Courier New'; line-height: normal">); </span><br style="font-family: 'Courier New'; line-height: normal" /><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// 32비트 타이머 PIT 4개 중 2채널만을 사용함</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// PIT 0 채널 10ms 주기로 초기화</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// CAN 0/1 TRX LED 제어용으로 사용함</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> pit_init(</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">0</span><span style="font-family: 'Courier New'; line-height: normal">, </span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">10000</span><span style="font-family: 'Courier New'; line-height: normal">); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> pit_start(</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">0</span><span style="font-family: 'Courier New'; line-height: normal">); </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// Start PIT 0 채널 timer</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// Enable global interrupt flag for all peripheral interrupts</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> EnableInterrupts; </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// user bps copy</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: blue">int</span><span style="font-family: 'Courier New'; line-height: normal"> i, offset = CAN_BPS_USER1; </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: blue">for</span><span style="font-family: 'Courier New'; line-height: normal">(i = </span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">0</span><span style="font-family: 'Courier New'; line-height: normal">; i < </span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">6</span><span style="font-family: 'Courier New'; line-height: normal">; i++) </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> { </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> CAN_BPS_CONFIG_TABLE[i + offset][</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">0</span><span style="font-family: 'Courier New'; line-height: normal">] = device_env.user_bps[i].PRESDIV;</span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> CAN_BPS_CONFIG_TABLE[i + offset][</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">1</span><span style="font-family: 'Courier New'; line-height: normal">] = device_env.user_bps[i].PROPSEG;</span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> CAN_BPS_CONFIG_TABLE[i + offset][</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">2</span><span style="font-family: 'Courier New'; line-height: normal">] = device_env.user_bps[i].PSEG1; </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> CAN_BPS_CONFIG_TABLE[i + offset][</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">3</span><span style="font-family: 'Courier New'; line-height: normal">] = device_env.user_bps[i].PSEG2; </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> } </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// Main LOOP</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: blue">while</span><span style="font-family: 'Courier New'; line-height: normal">(</span><span style="font-family: 'Courier New'; line-height: normal; color: maroon">1</span><span style="font-family: 'Courier New'; line-height: normal">) </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> { </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// CAN</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> CAN_Process(); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> </span><span style="font-family: 'Courier New'; line-height: normal; color: green">// SERIAL</span><span style="font-family: 'Courier New'; line-height: normal"> </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> Serial_Process(); </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal"> } </span><br style="font-family: 'Courier New'; line-height: normal" /><span style="font-family: 'Courier New'; line-height: normal">} </span></font></div> <div><span style="font-family: 'Courier New'; font-size: medium; line-height: normal"><br /></span></div> <div><span style="font-family: 'Courier New'; font-size: medium; line-height: normal"><br /></span></div> <div><font face="Courier New" size="2"><span style="line-height: normal">다들 아시는건데 나만 몰랐을수도...</span></font></div>
<font size="6"><b>부 정 선 거</b></font>
이 게시물을 추천한 분들의 목록입니다.
[1] 2014/01/16 16:43:10 203.246.***.74 nullpointer
456930[2] 2014/01/16 16:43:46 124.197.***.248 글냥이
54510[3] 2014/01/16 17:52:13 61.255.***.213 Cameo
251208[4] 2014/01/16 18:48:18 121.130.***.238 뢍
194613[5] 2014/01/16 19:35:31 223.62.***.89 취중코딩
502012[6] 2014/01/16 21:28:02 115.145.***.112 새까만샤프
179784[7] 2014/01/16 22:16:00 207.244.***.200 pysun
229497[8] 2014/01/17 01:51:01 1.214.***.133 행복한누리꾼
12785[9] 2014/01/17 16:08:18 203.226.***.31 Naaru
452055[10] 2014/01/17 19:28:23 118.33.***.213 큐어
14111
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.