void CSInstance :: Fill (dttm timestamp1, logical conversion, logical append ) { char *area; uint32 time; uint32 date; BEGINSEQ if ( !(area = Setup(CPT_timestamp,sizeof(dttm),conversion,append)) ) ERROR if ( timestamp1.GetTime().IsEmpty() ) time = -1; else time = timestamp1.GetTime().GetLongInt(); date = timestamp1.GetDate().GetLongInt(); if (conversion) { time = (uint32)htonl(time); date = (uint32)htonl(date); } StoreLong(area,date); StoreLong(area+4,time); converted = NO; RECOVER ENDSEQ }
void CSInstance :: Fill (ParmList *parameters, logical conversion, logical append ) { char *area; int count = parameters ? parameters->GetSize() : 0; CS_Handle *handles; PropertyHandle *prop_hdl; int indx0; BEGINSEQ if ( !(area = Setup(CPT_handle_list,sizeof(int32)+count*sizeof(CS_Handle),conversion,append)) ) ERROR if ( conversion ) count = htonl((u_long)count); StoreLong(area,count); converted = NO; handles = (CS_Handle *)(((int32 *)area)+1); for ( indx0 = 0; indx0 < count; indx0++, handles++ ) { prop_hdl = (*parameters)[indx0]; // if ( !prop_hdl->get_connection() ) SDBERR(99) memcpy(handles,(CS_Handle *)prop_hdl,sizeof(CS_Handle)); } RECOVER ENDSEQ }
main() { int i,n,m; init_IPIC(); ip = (IP_STEPPER*)IPABase; init_stepper(); init_encoder(); // ip->AxisCtrl1.Polarity = 0; ip->AxisCtrl1.Source = 0; ip->SyncCtrl = 0; ip->intVector = 0xF0; //programmer timer MCchip : une it toutes les TICK mili secondes StoreByte(MCchip_Base + General_Control_R, 0x2); /* MIEN */ StoreByte(MCchip_Base+Timer1_Control_R, 3); /* CEN COC */ StoreLong(MCchip_Base+Timer1_Compare_R, TICK*1000); StoreByte(MCchip_Base+Timer1_Interrupt_R, 0x11); /* IEN IL=1 */ SetHandler(((IVBR+Timer1_IRQ)*4 + VBR), it_timer ); sti(); //start ip->Motor1.csr = START_STOP_CMD | START_MOTION | FH1_SPEED | RAMP_UP_SPEED; while(1) stop(); }
main() { char s[20]; /////////////////////////////////////////// ////INITIALISATION DE LA CARTE ////////////////////////////////////////// /* * configurer le MCchip */ n_htos(0xFFFFFFFF,s); print (s); StoreByte(MCchip_Base + General_Control_R, 0x2); /* MIEN */ StoreByte(MCchip_Base + SCC_Interrupt_R, 0x12); /* IEN it z85230 niveau 2 */ /* * le numero du vecteur d'it du timer * est (InterruptVectorBaseR) + Timer1_IRQ * son adresse est 4 fois plus loin * on garde IVBR (MCchip) de 162Bug */ #define IVBR 80 StoreByte(MCchip_Base+Interrupt_Vector_Base_R, IVBR); SetHandler(((IVBR+Timer1_IRQ)*4 + VBR), schedule ); //programmer timer MCchip StoreByte(MCchip_Base+Timer1_Control_R, 3); /*CEN COC*/ /* une it toutes les TICK mili secondes */ StoreLong(MCchip_Base+Timer1_Compare_R, TICK*1000); StoreByte(MCchip_Base+Timer1_Interrupt_R, 0x11); /*IEN IL=1*/ //////////////////////////////////////////// //// INITIALISATION POUR LE NOYAU /////////////////////////////////////////// print("init hard ok"); init_mode_S(); //init en mode S //démasquer les it //sti(); // GO ! //démarrer les process utilisateurs. Ils n'accèdent aux primitives noyau que par trap //ils sont compilés avec une édition de liens indépendante de celle du noyau //lance un shell de debug. Il peut accéder aux structures de données internes du noyau //init(); //asm("jsr ___init"); //init en mode U //idle while (1) { //halt(); //pour libérer le bus } }
void CSInstance :: Fill (uint32 ulong_val, logical conversion, logical append ) { char *area; BEGINSEQ if ( !(area = Setup(CPT_long,sizeof(ulong_val),conversion,append)) ) ERROR if ( conversion ) ulong_val = htonl((u_long)ulong_val); StoreLong(area,ulong_val); converted = NO; RECOVER ENDSEQ }
void CSInstance :: Fill (int32 lindx0, logical conversion, logical append ) { char *area; BEGINSEQ if ( !(area = Setup(CPT_long,sizeof(lindx0),conversion,append)) ) ERROR if ( conversion ) lindx0 = htonl((u_long)lindx0); StoreLong(area,lindx0); converted = NO; RECOVER ENDSEQ }