'2022/03/17'에 해당되는 글 5건

  1. 2022.03.17 weston drm atomic
  2. 2022.03.17 mscgen
  3. 2022.03.17 gcc / 문자열 선언
  4. 2022.03.17 LSE PLC Write
  5. 2022.03.17 LSE PLC XG5000 / 주소
프로그램 사용/wayland2022. 3. 17. 16:39

테스트 중 아래와 같은 에러가 보여서 atomic이 먼가 찾아보는데..

[11:49:06.216] atomic: couldn't commit new state: Invalid argument
[11:49:06.217] repaint-flush failed: Invalid argument

 

말그대로.. 데이터의 atomic이 깨졌다는 건가..

At the other end there's struct drm_plane, representing a scanout engine that reads pixel data from memory represented by a struct drm_framebuffer and provides it to the display hardware.

[링크 : https://lwn.net/Articles/653071/]

 

backend-drm/kms.c 에서 해당 에러를 출력한다.

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

weston desktop-shell output destory  (0) 2022.06.08
weston debug message  (0) 2022.03.18
wayvnc 실행 실패  (0) 2022.02.17
wayland-scanner  (0) 2022.02.16
wayland wl_fixed_t 변수  (0) 2022.02.07
Posted by 구차니
파일방2022. 3. 17. 12:34

weston 소스를 보다보니 msc 라는 희한한 확장자가 보여서 조사.

initial-heads.msc

 

느낌을 봐서는 코드 제너레이터는 아니고 png로 무언가 생성하는 것 같은데

#!/usr/bin/mscgen -Tpng

msc {
hscale="1.5";

c [label = "compositor"], w [label = "libweston core"],
b [label = "backend"];

|||;

c => w [label = "weston_compositor_load_backend()"];
w => b [label = "init"];

--- [label = "Create initial heads"];
b box b [label = "Backend discovers an entity to create a head for."];

w <: b [label = "weston_head_init()"];
b box b [label = "assign hw resource to head"];
w <: b [label = "weston_head_set_monitor_strings()"];
w <: b [label = "weston_head_set_physical_size()"];
w <: b [label = "weston_head_set_subpixel()"];
w <: b [label = "weston_head_set_connection_status()"];
w <= b [label = "weston_compositor_add_head()"];
w <= w [label = "schedule heads_changed"];
w << b [label = "init success"];
c << w [label = "load success"];

|||;

--- [label = "Compositor start-up"];

c => w [label = "weston_compositor_flush_heads_changed()"];
c <<= w [label = "heads_changed callback"];

}

 

아래와 같이 시퀀스 다이어그램을 그려주는 역활이라고.

[링크 : https://www.mcternan.me.uk//mscgen/]

[링크 : https://iamaman.tistory.com/1642]

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

debian noroot 와 userland  (0) 2022.05.02
ansi to html  (0) 2022.03.31
android userland ubuntu  (0) 2022.03.03
bingwall (for ubuntu)  (0) 2022.01.19
bios 초기화 관련  (0) 2020.09.07
Posted by 구차니
프로그램 사용/gcc2022. 3. 17. 12:05

weston 소스를 보는데 희한한(?) 문자열 선언이 보여서 확인

static const char * const connector_type_names[] = {
[DRM_MODE_CONNECTOR_Unknown]     = "Unknown",
[DRM_MODE_CONNECTOR_VGA]         = "VGA",
[DRM_MODE_CONNECTOR_DVII]        = "DVI-I",
[DRM_MODE_CONNECTOR_DVID]        = "DVI-D",
[DRM_MODE_CONNECTOR_DVIA]        = "DVI-A",
[DRM_MODE_CONNECTOR_Composite]   = "Composite",
[DRM_MODE_CONNECTOR_SVIDEO]      = "SVIDEO",
[DRM_MODE_CONNECTOR_LVDS]        = "LVDS",
[DRM_MODE_CONNECTOR_Component]   = "Component",
[DRM_MODE_CONNECTOR_9PinDIN]     = "DIN",
[DRM_MODE_CONNECTOR_DisplayPort] = "DP",
[DRM_MODE_CONNECTOR_HDMIA]       = "HDMI-A",
[DRM_MODE_CONNECTOR_HDMIB]       = "HDMI-B",
[DRM_MODE_CONNECTOR_TV]          = "TV",
[DRM_MODE_CONNECTOR_eDP]         = "eDP",
[DRM_MODE_CONNECTOR_VIRTUAL]     = "Virtual",
[DRM_MODE_CONNECTOR_DSI]         = "DSI",
[DRM_MODE_CONNECTOR_DPI]         = "DPI",
};

 

느낌은 알겠는데.. 도대체 어디서 정의된 문법이냐...

$ cat str.c
#include <stdio.h>

static const char * const connector_type_names[] = {
        [0]     = "Unknown",
        [1]         = "VGA",
        [2]        = "DVI-I",
        [3]        = "DVI-D",
        [4]        = "DVI-A",
        [5]   = "Composite",
        [6]      = "SVIDEO",
        [7]        = "LVDS",
        [8]   = "Component",
        [9]     = "DIN",
        [10] = "DP",
        [11]       = "HDMI-A",
        [12]       = "HDMI-B",
        [13]          = "TV",
        [14]         = "eDP",
        [15]     = "Virtual",
        [16]         = "DSI",
        [17]         = "DPI",
};

void main()
{
        for(int i = 0; i < 10; i++)
                printf("%s\n",connector_type_names[i]);
}

$ gcc str.c
$ ./a.out
Unknown
VGA
DVI-I
DVI-D
DVI-A
Composite
SVIDEO
LVDS
Component
DIN

 

 

$ cat str.c
#include <stdio.h>

static const char * const connector_type_names[] = {
        [2]     = "Unknown",
        [1]         = "VGA",
        [0]        = "DVI-I",
        [3]        = "DVI-D",
        [4]        = "DVI-A",
        [5]   = "Composite",
        [6]      = "SVIDEO",
        [7]        = "LVDS",
        [8]   = "Component",
        [9]     = "DIN",
        [10] = "DP",
        [11]       = "HDMI-A",
        [12]       = "HDMI-B",
        [13]          = "TV",
        [14]         = "eDP",
        [15]     = "Virtual",
        [16]         = "DSI",
        [17]         = "DPI",
};

void main()
{
        for(int i = 0; i < 10; i++)
                printf("%s\n",connector_type_names[i]);
}

$ gcc str.c
$ ./a.out
DVI-I
VGA
Unknown
DVI-D
DVI-A
Composite
SVIDEO
LVDS
Component
DIN

 

 

+

ISO C99, GNU C90 에서 지원하는 듯.

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 C90 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 };

[링크 : https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html]

 

$ gcc -std=c89 str.c
str.c: In function ‘main’:
str.c:26:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  for(int i = 0; i < 10; i++)
  ^~~
str.c:26:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

$ gcc -std=c90 str.c
str.c: In function ‘main’:
str.c:26:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  for(int i = 0; i < 10; i++)
  ^~~
str.c:26:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

$ gcc -std=c99 str.c

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

gcc fstack-protector-strong  (0) 2022.12.06
gcc vectorization 실패  (0) 2022.06.02
static link  (0) 2022.02.07
구조체 타입과 변수명은 구분된다?  (0) 2021.11.18
gcc unsigned to signed upcast 테스트  (0) 2021.07.08
Posted by 구차니
하드웨어/PLC (LSE)2022. 3. 17. 10:40

어제 시도해서 왜 껐다키면 날아가나 했떠니 Write를 안해서 그랬던 듯.

 

 

RUN 모드로는 쓸수 없어서 STOP으로 바뀌고 쓰는 듯.

 

write 하고 나니 알아서 run 하겠냐고 물어본다.

 

project - open from plc를 통해 장치에서 설정을 읽어 오면

 

일단 cpue 라는 가장 싼 모델이라 usb로만 읽도록 되어있으니 아래와 같이 설정

'하드웨어 > PLC (LSE)' 카테고리의 다른 글

lse xgk-cpue rs232/modbus 연결  (0) 2022.03.21
plc timer 주기적인 on off  (0) 2022.03.18
lse modbus rs232  (0) 2022.03.18
LSE PLC XG5000 / 주소  (0) 2022.03.17
plc ladder diagram  (0) 2022.02.14
Posted by 구차니
하드웨어/PLC (LSE)2022. 3. 17. 10:35

그냥 장비를 쭈욱 추가해보는데

베이스 보드 위치에 따라서 주소가 중복되지 않게 할당되어 있고

장치에 연결된 주소가 늘었다 줄었다 할 뿐 프로그래머블 하게 장치별로 할당되는 건 아닌듯 하다.

 

아래는 16개짜리 장치 / 8개 짜리 장치를 등록했을때의 address map 이고

 

아래는 32개 / 16 / 16 / 16 / 8 / 8 / 8 8/ 16 개로 등록했을때의 address map

 

하나의 슬롯이라도 반드시 16비트만 볼 필요는 없는건가 싶다.

'하드웨어 > PLC (LSE)' 카테고리의 다른 글

lse xgk-cpue rs232/modbus 연결  (0) 2022.03.21
plc timer 주기적인 on off  (0) 2022.03.18
lse modbus rs232  (0) 2022.03.18
LSE PLC Write  (0) 2022.03.17
plc ladder diagram  (0) 2022.02.14
Posted by 구차니