Re: Мой китаес Bernardo KF25 Top (клон BF20)
Добавлено: 11 фев 2013, 14:36
А дремель на что? С тонким диском.. там делов то на пару минут...Алексс писал(а):самое главное - нет пилы делать пропилы.
Статьи, обзоры, цены на станки и комплектующие.
https://cnc-club.ru/forum/
А дремель на что? С тонким диском.. там делов то на пару минут...Алексс писал(а):самое главное - нет пилы делать пропилы.
где? почем?Алексс писал(а):заказал себе вот такой корпус:
Код: Выделить всё
static int SignExtend( int n, int nMax )
{
n &= nMax;
if ( n & ((nMax+1)>>1) )
{
n |= ~nMax;
}
return n;
}
static int Diff( int n, int old, int min, int max )
{
int nDiff = n - old;
return SignExtend(nDiff,max-min);
}
Код: Выделить всё
component out8;
pin out unsigned out_ "Output value; only low 8 bits are used";
param r unsigned ioaddr;
function _;
option count_function;
option extra_setup;
option extra_cleanup;
option constructable no;
license "GPL";
;;
#include <asm/io.h>
#include <stdlib.h>
#define MAX 8
int io[MAX] = {0,};
RTAPI_MP_ARRAY_INT(io, MAX, "I/O addresses of out8 boards");
int get_count(void) {
int i = 0;
for(i=0; i<MAX && io[i]; i++) { /* Nothing */ }
return i;
}
EXTRA_SETUP() {
if(!rtapi_request_region(io[extra_arg], 1, "out8")) {
// set this I/O port to 0 so that EXTRA_CLEANUP does not release the IO
// ports that were never requested.
io[extra_arg] = 0;
return -EBUSY;
}
ioaddr = io[extra_arg];
return 0;
}
EXTRA_CLEANUP() {
int i;
for(i=0; i < MAX && io[i]; i++) {
rtapi_release_region(io[i], 1);
}
}
FUNCTION(_) { outb(out_, ioaddr); }
Код: Выделить всё
root@nkp-desktop:/usr/include# sudo comp --install out8.comp
make KBUILD_EXTRA_SYMBOLS=/usr/realtime-2.6.32-122-rtai/modules/linuxcnc/Module.symvers -C /usr/src/linux-headers-2.6.32-122-rtai SUBDIRS=`pwd` CC=gcc V=0 modules
make[1]: Вход в каталог `/usr/src/linux-headers-2.6.32-122-rtai'
CC [M] /tmp/tmpQ6JGyO/out8.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: warning: this is the location of the previous definition
In file included from /usr/include/features.h:346,
from /usr/include/stdlib.h:25,
from out8.comp:15:
/usr/include/sys/cdefs.h:287:1: warning: "__always_inline" redefined
In file included from include/linux/compiler-gcc.h:86,
from include/linux/compiler.h:40,
from include/linux/stddef.h:4,
from include/linux/posix_types.h:4,
from include/linux/types.h:14,
from include/linux/capability.h:16,
from include/linux/sched.h:52,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/compiler-gcc4.h:15:1: warning: this is the location of the previous definition
In file included from /usr/include/stdlib.h:42,
from out8.comp:15:
/usr/include/bits/waitflags.h:26:1: warning: "WNOHANG" redefined
In file included from include/linux/completion.h:11,
from include/linux/mm_types.h:12,
from include/linux/sched.h:63,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/wait.h:4:1: warning: this is the location of the previous definition
In file included from /usr/include/stdlib.h:42,
from out8.comp:15:
/usr/include/bits/waitflags.h:27:1: warning: "WUNTRACED" redefined
In file included from include/linux/completion.h:11,
from include/linux/mm_types.h:12,
from include/linux/sched.h:63,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/wait.h:5:1: warning: this is the location of the previous definition
In file included from /usr/include/stdlib.h:42,
from out8.comp:15:
/usr/include/bits/waitflags.h:30:1: warning: "WSTOPPED" redefined
In file included from include/linux/completion.h:11,
from include/linux/mm_types.h:12,
from include/linux/sched.h:63,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/wait.h:6:1: warning: this is the location of the previous definition
In file included from /usr/include/stdlib.h:42,
from out8.comp:15:
/usr/include/bits/waitflags.h:31:1: warning: "WEXITED" redefined
In file included from include/linux/completion.h:11,
from include/linux/mm_types.h:12,
from include/linux/sched.h:63,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/wait.h:7:1: warning: this is the location of the previous definition
In file included from /usr/include/stdlib.h:42,
from out8.comp:15:
/usr/include/bits/waitflags.h:32:1: warning: "WCONTINUED" redefined
In file included from include/linux/completion.h:11,
from include/linux/mm_types.h:12,
from include/linux/sched.h:63,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/wait.h:8:1: warning: this is the location of the previous definition
In file included from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/types.h:35: error: redefinition of typedef ‘u_char’
include/linux/types.h:88: note: previous declaration of ‘u_char’ was here
/usr/include/sys/types.h:36: error: redefinition of typedef ‘u_short’
include/linux/types.h:89: note: previous declaration of ‘u_short’ was here
/usr/include/sys/types.h:37: error: redefinition of typedef ‘u_int’
include/linux/types.h:90: note: previous declaration of ‘u_int’ was here
/usr/include/sys/types.h:38: error: redefinition of typedef ‘u_long’
include/linux/types.h:91: note: previous declaration of ‘u_long’ was here
/usr/include/sys/types.h:46: error: redefinition of typedef ‘loff_t’
include/linux/types.h:50: note: previous declaration of ‘loff_t’ was here
/usr/include/sys/types.h:50: error: redefinition of typedef ‘ino_t’
include/linux/types.h:22: note: previous declaration of ‘ino_t’ was here
/usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’
include/linux/types.h:21: note: previous declaration of ‘dev_t’ was here
/usr/include/sys/types.h:67: error: redefinition of typedef ‘gid_t’
include/linux/types.h:37: note: previous declaration of ‘gid_t’ was here
/usr/include/sys/types.h:72: error: conflicting types for ‘mode_t’
include/linux/types.h:23: note: previous declaration of ‘mode_t’ was here
/usr/include/sys/types.h:77: error: conflicting types for ‘nlink_t’
include/linux/types.h:24: note: previous declaration of ‘nlink_t’ was here
/usr/include/sys/types.h:82: error: redefinition of typedef ‘uid_t’
include/linux/types.h:36: note: previous declaration of ‘uid_t’ was here
/usr/include/sys/types.h:88: error: redefinition of typedef ‘off_t’
include/linux/types.h:25: note: previous declaration of ‘off_t’ was here
/usr/include/sys/types.h:100: error: redefinition of typedef ‘pid_t’
include/linux/types.h:26: note: previous declaration of ‘pid_t’ was here
/usr/include/sys/types.h:110: error: redefinition of typedef ‘ssize_t’
include/linux/types.h:64: note: previous declaration of ‘ssize_t’ was here
/usr/include/sys/types.h:116: error: redefinition of typedef ‘daddr_t’
include/linux/types.h:27: note: previous declaration of ‘daddr_t’ was here
/usr/include/sys/types.h:117: error: redefinition of typedef ‘caddr_t’
include/linux/types.h:84: note: previous declaration of ‘caddr_t’ was here
/usr/include/sys/types.h:123: error: redefinition of typedef ‘key_t’
include/linux/types.h:28: note: previous declaration of ‘key_t’ was here
In file included from /usr/include/sys/types.h:133,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/time.h:60: error: redefinition of typedef ‘clock_t’
include/linux/types.h:79: note: previous declaration of ‘clock_t’ was here
/usr/include/time.h:76: error: redefinition of typedef ‘time_t’
include/linux/types.h:74: note: previous declaration of ‘time_t’ was here
/usr/include/time.h:92: error: redefinition of typedef ‘clockid_t’
include/linux/types.h:31: note: previous declaration of ‘clockid_t’ was here
/usr/include/time.h:104: error: conflicting types for ‘timer_t’
include/linux/types.h:30: note: previous declaration of ‘timer_t’ was here
In file included from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/types.h:141: error: redefinition of typedef ‘suseconds_t’
include/linux/types.h:29: note: previous declaration of ‘suseconds_t’ was here
In file included from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/types.h:151: error: redefinition of typedef ‘ulong’
include/linux/types.h:97: note: previous declaration of ‘ulong’ was here
/usr/include/sys/types.h:152: error: redefinition of typedef ‘ushort’
include/linux/types.h:95: note: previous declaration of ‘ushort’ was here
/usr/include/sys/types.h:153: error: redefinition of typedef ‘uint’
include/linux/types.h:96: note: previous declaration of ‘uint’ was here
/usr/include/sys/types.h:195: error: redefinition of typedef ‘int8_t’
include/linux/types.h:103: note: previous declaration of ‘int8_t’ was here
/usr/include/sys/types.h:196: error: redefinition of typedef ‘int16_t’
include/linux/types.h:105: note: previous declaration of ‘int16_t’ was here
/usr/include/sys/types.h:197: error: redefinition of typedef ‘int32_t’
include/linux/types.h:107: note: previous declaration of ‘int32_t’ was here
/usr/include/sys/types.h:198: error: redefinition of typedef ‘int64_t’
include/linux/types.h:118: note: previous declaration of ‘int64_t’ was here
/usr/include/sys/types.h:201: error: redefinition of typedef ‘u_int8_t’
include/linux/types.h:102: note: previous declaration of ‘u_int8_t’ was here
/usr/include/sys/types.h:202: error: redefinition of typedef ‘u_int16_t’
include/linux/types.h:104: note: previous declaration of ‘u_int16_t’ was here
/usr/include/sys/types.h:203: error: redefinition of typedef ‘u_int32_t’
include/linux/types.h:106: note: previous declaration of ‘u_int32_t’ was here
/usr/include/sys/types.h:204: error: redefinition of typedef ‘u_int64_t’
include/linux/types.h:117: note: previous declaration of ‘u_int64_t’ was here
In file included from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/types.h:212:1: warning: "__BIT_TYPES_DEFINED__" redefined
In file included from include/linux/capability.h:16,
from include/linux/sched.h:52,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/types.h:100:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/select.h:31,
from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/bits/select.h:34:1: warning: "__FD_ZERO" redefined
In file included from /usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types.h:3,
from include/linux/posix_types.h:47,
from include/linux/types.h:14,
from include/linux/capability.h:16,
from include/linux/sched.h:52,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
/usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types_32.h:72:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/select.h:31,
from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/bits/select.h:59:1: warning: "__FD_SET" redefined
In file included from /usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types.h:3,
from include/linux/posix_types.h:47,
from include/linux/types.h:14,
from include/linux/capability.h:16,
from include/linux/sched.h:52,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
/usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types_32.h:48:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/select.h:31,
from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/bits/select.h:60:1: warning: "__FD_CLR" redefined
In file included from /usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types.h:3,
from include/linux/posix_types.h:47,
from include/linux/types.h:14,
from include/linux/capability.h:16,
from include/linux/sched.h:52,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
/usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types_32.h:54:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/select.h:31,
from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/bits/select.h:61:1: warning: "__FD_ISSET" redefined
In file included from /usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types.h:3,
from include/linux/posix_types.h:47,
from include/linux/types.h:14,
from include/linux/capability.h:16,
from include/linux/sched.h:52,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
/usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/posix_types_32.h:60:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/select.h:38: error: conflicting types for ‘sigset_t’
/usr/src/linux-headers-2.6.32-122-rtai/arch/x86/include/asm/signal.h:32: note: previous declaration of ‘sigset_t’ was here
In file included from /usr/include/sys/select.h:44,
from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/time.h:121: error: redefinition of ‘struct timespec’
In file included from /usr/include/sys/select.h:46,
from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/bits/time.h:70: error: redefinition of ‘struct timeval’
In file included from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/select.h:78: error: conflicting types for ‘fd_set’
include/linux/types.h:20: note: previous declaration of ‘fd_set’ was here
In file included from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/select.h:93:1: warning: "FD_SET" redefined
In file included from include/linux/timex.h:56,
from include/linux/sched.h:56,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/time.h:246:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/select.h:94:1: warning: "FD_CLR" redefined
In file included from include/linux/timex.h:56,
from include/linux/sched.h:56,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/time.h:247:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/select.h:95:1: warning: "FD_ISSET" redefined
In file included from include/linux/timex.h:56,
from include/linux/sched.h:56,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/time.h:248:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/types.h:220,
from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/select.h:96:1: warning: "FD_ZERO" redefined
In file included from include/linux/timex.h:56,
from include/linux/sched.h:56,
from /usr/include/linuxcnc/rtapi.h:210,
from /tmp/tmpQ6JGyO/out8.c:2:
include/linux/time.h:249:1: warning: this is the location of the previous definition
In file included from /usr/include/stdlib.h:320,
from out8.comp:15:
/usr/include/sys/types.h:235: error: conflicting types for ‘blkcnt_t’
include/linux/types.h:136: note: previous declaration of ‘blkcnt_t’ was here
In file included from out8.comp:15:
/usr/include/stdlib.h:423: warning: declaration does not declare anything
In file included from out8.comp:15:
/usr/include/stdlib.h:766: error: expected identifier or ‘(’ before ‘{’ token
make[2]: *** [/tmp/tmpQ6JGyO/out8.o] Ошибка 1
make[1]: *** [_module_/tmp/tmpQ6JGyO] Ошибка 2
make[1]: Выход из каталога `/usr/src/linux-headers-2.6.32-122-rtai'
make: *** [modules] Ошибка 2
root@nkp-desktop:/usr/include#
Си, вроде, не имеет дурной привычки целиком библиотеки подцеплять. Какие функции надо, такие и будут подключены. По крайней мере раньше так было.Nick писал(а):stdlib - наверняка большая библиотека
qsort. придется писать сортировку руками - ацтой.Nick писал(а):А для чего она тебе в нем
nkp писал(а):/usr/include/sys/types.h:151: error: redefinition of typedef ‘ulong’
include/linux/types.h:97: note: previous declaration of ‘ulong’ was here
скорее всего, потому как файл /usr/include/stdlib.h присутствует.Serg-tmn писал(а):Может не там ищется?