]> rtime.felk.cvut.cz Git - hydro.git/blobdiff - app/control/board.c
Deleting of old directory
[hydro.git] / app / control / board.c
diff --git a/app/control/board.c b/app/control/board.c
deleted file mode 100644 (file)
index 365fbf0..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-
-#include <system_def.h>
-#include <cpu_def.h>
-#include <stdio.h>
-
-#include "board.h"
-
-// OBJECT INTERFACE VARIABLES
-uint16_t status_val;
-uint16_t oi_fan;
-uint16_t oi_cid_fan;
-uint16_t oi_humidifier;
-uint16_t oi_cid_humidifier;
-uint16_t oi_light;
-uint16_t oi_cid_light;
-uint16_t oi_period;
-
-// OBJECT INTERFACE FUNCTIONS
-int oi_cid_fan_wrfnc(ULOI_PARAM_coninfo void *context){
-    uloi_uint_wrfnc(ULOI_ARG_coninfo context);
-    return 1;
-}
-
-int oi_cid_humidifier_wrfnc(ULOI_PARAM_coninfo void *context){
-    uloi_uint_wrfnc(ULOI_ARG_coninfo context);
-    return 1;
-}
-
-int oi_cid_light_wrfnc(ULOI_PARAM_coninfo void *context){
-    uloi_uint_wrfnc(ULOI_ARG_coninfo context);
-    return 1;
-}
-
-int oi_period_wrfnc(ULOI_PARAM_coninfo void *context){
-    uloi_uint_wrfnc(ULOI_ARG_coninfo context);
-    return 1;
-}
-
-//*********************************************************
-int oi_fan_wrfnc(ULOI_PARAM_coninfo void *context){
-    uloi_uint_wrfnc(ULOI_ARG_coninfo context);
-    if (oi_fan == 1) {
-        SET_OUT_PIN(OUT_PORT,P1_27_FAN);
-        printf("FAN PIN UP\n");
-    } else {
-        CLR_OUT_PIN(OUT_PORT,P1_27_FAN);
-        printf("FAN PIN DOWN\n");
-    }
-    return 1;
-}
-
-int oi_humidifier_wrfnc(ULOI_PARAM_coninfo void *context){
-    uloi_uint_wrfnc(ULOI_ARG_coninfo context);
-    if (oi_humidifier == 1) {
-        SET_OUT_PIN(OUT_PORT,P1_28_HUMIDIFIER);
-        printf("HUM PIN UP\n");
-    } else {
-        CLR_OUT_PIN(OUT_PORT,P1_28_HUMIDIFIER);
-        printf("HUM PIN DOWN\n");
-    }
-    return 1;
-}
-
-int oi_light_wrfnc(ULOI_PARAM_coninfo void *context){
-    uloi_uint_wrfnc(ULOI_ARG_coninfo context);
-    if (oi_light == 1) {
-        SET_OUT_PIN(OUT_PORT,P1_29_LIGHT);
-        printf("LIGHT PIN UP\n");
-    } else {
-        CLR_OUT_PIN(OUT_PORT,P1_29_LIGHT);
-        printf("LIGHT PIN DOWN\n");
-    }
-    return 1;
-}
-//*********************************************************
-
-void send_data() {
-    int msgsend;
-    uchar *buf;
-    int i, len;
-
-    len = DATA_BUF_LEN + 6;
-//     if (oi_period == 1) len = len + 6;
-
-    // preparing of msg
-    buf = (uchar *) malloc(len*sizeof(uchar));  // NULL NULL NULL TEMPERATURE_CID len_data oi_temperature CID_HUM len_data oi_humidity
-    for (i=0; i<=2; i++) buf[i] = 0;
-
-    if (oi_period == 1){
-        int2buf(&buf[3],HEART_CID);
-        int2buf(&buf[5],2);
-        int2buf(&buf[7],status_val);
-    }
-
-    msgsend = ul_send_query(ul_fd, ul_dyac->ul_dysa, UL_CMD_PDO, UL_BFL_NORE, (void*) buf, len);
-    printf("[I] DATA\n");
-    free(buf);
-    ul_freemsg(ul_fd);
-}
-
-void accept_SDO(void) {
-        // setting lan configuration
-        if ((ul_inepoll(ul_fd)>0) && (ul_acceptmsg(ul_fd, &msginfo)>=0)) {
-            if ((msginfo.cmd != UL_CMD_PDO) && (msginfo.sadr != 98)) {
-                if (!(msginfo.flg&(UL_BFL_PROC | UL_BFL_FAIL))) {
-                    //waiting for msg from bus
-                    if (uloi_process_msg(ULOI_ARG_coninfo (uloi_objdes_array_t*)&uloi_objdes_main, &msginfo)<0) {
-                        //checking dynamic adresation
-                        if (uldy_process_msg(ULDY_ARG_ul_dyac &msginfo)>=0){
-                            printf("message recieved - UL_CMD_NCS, sadr: %i, dadr: %i, cmd: %i\n",msginfo.sadr, msginfo.dadr, msginfo.cmd);
-                            printf("server addr :%i\n",ul_dyac->ul_dysa);
-                        } else {
-                            ul_freemsg(ul_fd);
-                            printf("problem in uldy_process_msg\n");
-                        }
-                    } else {
-                        printf("ULOI message processed\n");
-                    }
-                } else {
-                    ul_freemsg(ul_fd);
-                }
-            }
-        }
-}
-
-void setmyaddr(void){
-    ul_setmyadr(ul_fd,98);
-}
-
-void oiinit(void){
-    oi_cid_fan=243;
-    oi_cid_humidifier=244;
-    oi_cid_light=245;
-    oi_period=1;
-    status_val = 5;
-}
-
-void work_with(void){
-
-    PINSEL1 &= 0xFFFFB3FF;
-
-    // u vetsi karbicky je SET z 0 do 3.3
-    // u mensi je SET z -3.3 do 0
-    // varpins  yy
-
-//     IO0SET = P0_21_BIT;
-//     IO0SET = P0_22_BIT;
-
-    SET_OUT_PIN(OUT_PORT, P1_27_FAN);
-    CLR_OUT_PIN(OUT_PORT, P1_28_HUMIDIFIER);
-    SET_OUT_PIN(OUT_PORT, P1_29_LIGHT);
-
-    IO0SET = LED1_BIT; //vypinani LED
-    IO0CLR = LED2_BIT; //zapinani LED
-
-//     IO0CLR = LED1_BIT;
-//     IO0SET = LED2_BIT;
-}