'잡동사니'에 해당되는 글 13248건

  1. 2015.10.25 ADEX 2015 사진은 .. 나중에 ㅠㅠ
  2. 2015.10.24 smardi GAM.r
  3. 2015.10.23 bitband 고찰..
  4. 2015.10.23 캡콤 험블번들 지름
  5. 2015.10.21 mmap / ioremap
  6. 2015.10.21 리눅스 모듈 - 세마포어 / 뮤텍스
  7. 2015.10.21 linux kernel module module_init() 매크로
  8. 2015.10.21 gcc 초기화 관련
  9. 2015.10.21 다배장 정수?
  10. 2015.10.20 휴 모멘트?

일단.. 아내도 끌려오는 바람에

F-22 실외전시만 찍고 거의 바로 후퇴..

하이라이트인 F-22 비행 시범은 ㅠㅠㅠㅠㅠㅠㅠㅠ

'개소리 왈왈 > 2015 에어쇼' 카테고리의 다른 글

ADEX 2015  (0) 2015.10.27
ADEX 2015 in 성남 @ 서울공항  (2) 2015.07.15
Posted by 구차니

벼룩시장에서 천원에 획득 ㅋ

근데 알고보니 갤럭시 노트 2용이라

아내의 갤럭시 노트 4에는 작아서 안맞고..

내 갤럭시 S2에는 너무 크고.. 게다가 커넥터 문제로 이상하게 인식해서 쥐쥐!


중고로 갤럭시 노트 2 라도 살까 해서 기웃거려보니.. 중고가 15만 ㄷㄷㄷ

천원짜리(?) 사려다가 15만원 나가게 생겼네


아무튼 조이스틱으로 인식시켜 pc에서도 사용이 가능하다고 하니

고민을 해봐야겠다..



원래는 5~6만원 정도 하던건데

아마 이가격이면 망했을지도?

[링크 : http://blog.naver.com/leeys2714/220021133666]



+

야이 데브시스터즈 언넝 돌려줘!!!


[링크 : https://play.google.com/store/apps/details?id=com.smardi.gamrbrochure&hl=ko]

'개소리 왈왈 > 모바일 생활' 카테고리의 다른 글

아이폰 어플 파일 관련  (0) 2015.12.21
다음달은 5천원을 목표로!!  (0) 2015.11.13
요금제 변경  (0) 2015.10.15
디펜스 성공!  (0) 2015.05.15
드디어!! 약정 할부 끝? ㅋㅋ  (0) 2015.03.16
Posted by 구차니
embeded/Cortex-M3 Ti2015. 10. 23. 16:07

이게 정말 효율적일까? 라는 의문이 새록새록


일단.. 주소 연산하려면

* 2번(혹은 << 2번)

+ 1번

3번의 연산


만약 1비트를 조작하기 위해서 저 연산을 해야 하는데...

negation 과 and 연산이면 충분한데.. 오히려 연산량이 더 필요할 지도?

stellarisware의 bitband.c 예제

#define HWREGBITW(x, b)                                                       \

        HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 |                \

              (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))


    for(ulIdx = 0; ulIdx < 32; ulIdx++)

    {

        HWREGBITW(&g_ulValue, 31 - ulIdx) = (0xdecafbad >> (31 - ulIdx)) & 1;

        PrintValue(g_ulValue);

        Delay(1);

    }




32비트 주소체계라 4바이트 씩 띄엄띄엄 값이 들어있다.


[링크 : http://www.ti.com/lit/ds/symlink/lm3s1968.pdf]

2013/08/16 - [embeded/Cortex-M3 Ti] - bitband / cortex-m3


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

axf to bin  (6) 2015.11.11
lm3s1607 / lm3s811 비교  (0) 2015.11.03
lm3s617 stepper rdk  (0) 2015.10.13
lm3s spi / ssi  (0) 2015.10.06
lm3s stellarisware SPI  (0) 2015.10.05
Posted by 구차니

걍 우울해서 지름

초반에 샀으면 5.6$ 급에 질렀을텐데 끝물이라 많이도 올랐네...

remember me 에 혹해서 지른것도 있긴 한데...

지역 락 걸린 레지던트 이블 때문에 돈 낭비 한건 아닌지 모르겠네..






Posted by 구차니
Linux API/linux2015. 10. 21. 14:50

die.net에서 ioremap 찾으니 mmap이 나오는 신기한 현상..

그래서 찾아보니..


ioremap은 커널에서 쓰는 함수

mmap은 유저레벨에서 사용하는 함수


즉, 모듈에서는 ioremap

어플리케이션에서는 mmap으로


[링크 : http://torystory.tistory.com/20]



ioremap 가상주소 -> 물리주소

iounmap 물리주소 -> 가상주소

[링크 : http://mudweb.tistory.com/11]

'Linux API > linux' 카테고리의 다른 글

signal  (0) 2015.10.26
select()  (0) 2015.10.26
리눅스 모듈 - 세마포어 / 뮤텍스  (0) 2015.10.21
linux kernel module module_init() 매크로  (0) 2015.10.21
리눅스 타이머 예제 setitimer() / sigaction()  (0) 2015.10.13
Posted by 구차니
Linux API/linux2015. 10. 21. 13:32

써봐야지 머... ㅠㅠ


[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/system_programing/IPC/semaphores]

[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Thread/Beginning/Mutex]

[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/system_programing/Book_LSP/ch07_Thread]


sema_init()

[링크 : http://lxr.free-electrons.com/source/include/linux/semaphore.h]



뮤텍스 = 바이너리 세마포어


우선 하는 일에 대해서 mutex는 binary semaphore와 많이 동일하고요.

구조적인 측면과 동작 측면에서는 mutex는 owner라는 개념 있는데 반해 binary semaphore는 owner라는 개념이 없다는 차이가 있습니다.

 

이로 인해 mutex는 lock한 task만 unlock 할수 있는데 반해 semaphore는 아무 task나 unlock이 가능하죠.

[링크 : http://www.iamroot.org/xe/QnA/36692]


[링크 : http://ninako21.tistory.com/500]

[링크 : http://topnanis.tistory.com/195]



+ 2015.10.29

[링크 : http://egloos.zum.com/tiger5net/v/5537603]

'Linux API > linux' 카테고리의 다른 글

select()  (0) 2015.10.26
mmap / ioremap  (0) 2015.10.21
linux kernel module module_init() 매크로  (0) 2015.10.21
리눅스 타이머 예제 setitimer() / sigaction()  (0) 2015.10.13
clock_gettime  (0) 2015.08.09
Posted by 구차니
Linux API/linux2015. 10. 21. 12:24

module_init()는 __initcall()로 치환되고

__initcal()은 static inicall_t __initcall_modulename __init_call = modulename

으로 치환되어

initcall_t 타입의 정적변수로 생성된다.

결국은... 다른 파일에서 __init_call 하나로 끌어갈수 있으려나?

(물론 내부 인터페이스 함수가 존재할 듯?)


#define __initcall(fn) static initcall_t __initcall_##fn __init_call = fn

#define module_init(x)  __initcall(x);


[링크 : http://www.compsoc.man.ac.uk/~moz/kernelnewbies/documents/initcall/kernel.html]


#define __exitcall(fn) \

static exitcall_t __exitcall_##fn __exit_call = fn

#define module_exit(x) __exitcall(x);


[링크 : https://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/include/linux/init.h] 


#define module_param(name, type, perm)                          \

        module_param_named(name, name, type, perm)


#define module_param_named(name, value, type, perm)                        \

        param_check_##type(name, &(value));                                \

        module_param_cb(name, &param_ops_##type, &value, perm);            \

        __MODULE_PARM_TYPE(name, #type)


#define module_param_cb(name, ops, arg, perm)                                 \

        __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0)


#define __module_param_call(prefix, name, ops, arg, perm, level, flags) \

        /* Default value instead of permissions? */                     \

        static const char __param_str_##name[] = prefix #name;          \

        static struct kernel_param __moduleparam_const __param_##name   \

        __used                                                          \

    __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \

        = { __param_str_##name, THIS_MODULE, ops,                       \

            VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }


#define __moduleparam_const const


[링크 : http://lxr.free-electrons.com/source/include/linux/moduleparam.h]


[링크 : http://www.joinc.co.kr/.../Site/Embedded/Documents/WritingDeviceDriversInLinux]

[링크 : https://www.kernel.org/doc/htmldocs/kernel-hacking/routines-init-again.html]

'Linux API > linux' 카테고리의 다른 글

select()  (0) 2015.10.26
mmap / ioremap  (0) 2015.10.21
리눅스 모듈 - 세마포어 / 뮤텍스  (0) 2015.10.21
리눅스 타이머 예제 setitimer() / sigaction()  (0) 2015.10.13
clock_gettime  (0) 2015.08.09
Posted by 구차니
프로그램 사용/gcc2015. 10. 21. 11:33

C99 관련추가 내용인가?

일단은 GCC-2.5 이후 부터 지원하는 기능으로 보인다.

2009/05/28 - [Programming/C / Win32 / MFC] - C99 구조체 초기화 하기


5.22 Designated Initializers


Standard C89 requires the elements of an initializer to appear in a fixed order, the same as the order of the elements in the array or structure being initialized.


In ISO C99 you can give the elements in any order, specifying the array indices or structure field names they apply to, and GNU C allows this as an extension in C89 mode as well. This extension is not implemented in GNU C++.


To specify an array index, write `[index] =' before the element value. For example,


 

int a[6] = { [4] = 29, [2] = 15 };


is equivalent to


 

int a[6] = { 0, 0, 15, 0, 29, 0 };


The index values must be constant expressions, even if the array being initialized is automatic.


An alternative syntax for this which has been obsolete since GCC 2.5 but GCC still accepts is to write `[index]' before the element value, with no `='.


To initialize a range of elements to the same value, write `[first ... last] = value'. This is a GNU extension. For example,


 

int widths[] = { [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 };


If the value in it has side-effects, the side-effects will happen only once, not for each initialized field by the range initializer.


Note that the length of the array is the highest value specified plus one.


In a structure initializer, specify the name of a field to initialize with `.fieldname =' before the element value. For example, given the following structure,


 

struct point { int x, y; };


the following initialization


 

struct point p = { .y = yvalue, .x = xvalue };


is equivalent to


 

struct point p = { xvalue, yvalue };


Another syntax which has the same meaning, obsolete since GCC 2.5, is `fieldname:', as shown here:


 

struct point p = { y: yvalue, x: xvalue };


The `[index]' or `.fieldname' is known as a designator. You can also use a designator (or the obsolete colon syntax) when initializing a union, to specify which element of the union should be used. For example,


 

union foo { int i; double d; };


union foo f = { .d = 4 };


will convert 4 to a double to store it in the union using the second element. By contrast, casting 4 to type union foo would store it into the union as the integer i, since it is an integer. (See section 5.24 Cast to a Union Type.)


You can combine this technique of naming elements with ordinary C initialization of successive elements. Each initializer element that does not have a designator applies to the next consecutive element of the array or structure. For example,


 

int a[6] = { [1] = v1, v2, [4] = v4 };


is equivalent to


 

int a[6] = { 0, v1, v2, 0, v4, 0 };


Labeling the elements of an array initializer is especially useful when the indices are characters or belong to an enum type. For example:


 

int whitespace[256]

  = { [' '] = 1, ['\t'] = 1, ['\h'] = 1,

      ['\f'] = 1, ['\n'] = 1, ['\r'] = 1 };


You can also write a series of `.fieldname' and `[index]' designators before an `=' to specify a nested subobject to initialize; the list is taken relative to the subobject corresponding to the closest surrounding brace pair. For example, with the `struct point' declaration above:


 

struct point ptarray[10] = { [2].y = yv2, [2].x = xv2, [0].x = xv0 };


If the same field is initialized multiple times, it will have value from the last initialization. If any such overridden initialization has side-effect, it is unspecified whether the side-effect happens or not. Currently, gcc will discard them and issue a warning.


[링크 : https://gcc.gnu.org/onlinedocs/gcc-3.0.1/gcc_5.html]

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

gcc dependency .d 파일?  (0) 2016.03.28
gcc -M -MM  (0) 2015.12.17
precompiled header on GCC (라즈베리로 테스트)  (2) 2015.07.30
gcc에서 precompiled header 사용하기  (0) 2015.07.29
gcc 64bit 변수 선언하기  (0) 2015.07.14
Posted by 구차니
Programming2015. 10. 21. 10:52

먼가해서 찾아봐도.. 일본식 조어인가?

多倍長整数

多 (많을 다)

倍 (곱 배, 등질 패)

長 (길 장, 어른 장)

整 (가지런할 정)

数 (셈 수, 자주 삭, 촘촘할 촉)


[링크 : https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic] >> 일본어 판으로


gmp 라는 녀석으로 gnu 라이브러리 존재

[링크 : https://gmplib.org/]

'Programming' 카테고리의 다른 글

swift 문법(함수/변수)  (0) 2014.06.08
apple 차세대 언어 swift  (0) 2014.06.03
ARToolKit / openVRML  (0) 2012.12.25
윤년 계산하기  (2) 2012.05.21
TBB/IPP  (2) 2012.02.12
Posted by 구차니
Programming/openCV2015. 10. 20. 17:21

hue moment로

hue의 유사값을 찾는것으로 생각된다..



모멘트를 계산하는 효과적인 방법 중 하나는 휴모멘트를 이용하는 것인데

1. 먼저 cvFindContours() 로 contours를 구하고

2. cvContourMoments()로 CvMoments구조체를 만든 후 

3. cvGetHuMoments()로 cvHuMoments구조체를 만든다. 

4. 그리고 cvHuMoments.hu1(hu2...) 식으로 접근하여 휴 모멘트를 구한다.


double cvMatchShapes(

 const void* object1,                       //그레이 스케일 영상 || contours

 const void* object2,                       //그레이 스케일 영상 || contours

 int method,

 double parameter=0;                       //무조건 0 (사용X)

);

[링크 : http://blog.naver.com/cyber3208/60163282137]

[링크 : http://lueseypid.tistory.com/88]


+

[링크 : http://docs.opencv.org/2.4.10/doc/tutorials/imgproc/shapedescriptors/moments/moments.html]

[링크 : http://docs.opencv.org/master/d0/d49/tutorial_moments.html]

'Programming > openCV' 카테고리의 다른 글

openMP + openCV 실패한 이유가..  (0) 2015.11.27
openMP + openCV 미스테리..  (0) 2015.11.09
opencv 카메라 왜곡 수정  (0) 2015.10.20
opencv sift surf  (0) 2015.10.20
시야각 내 각도 계산  (0) 2015.10.14
Posted by 구차니