alpha_datapool
Revision 1:51a5a9f66f61, committed 2017-09-08
- Comitter:
- Komazawa_sun
- Date:
- Fri Sep 08 03:27:55 2017 +0000
- Parent:
- 0:2c82568e1790
- Commit message:
- ????; ;
Changed in this revision
diff -r 2c82568e1790 -r 51a5a9f66f61 AlphaPool.cpp --- a/AlphaPool.cpp Wed Aug 30 05:14:05 2017 +0000 +++ b/AlphaPool.cpp Fri Sep 08 03:27:55 2017 +0000 @@ -26,18 +26,10 @@ data_index[16] = ctrl.mode2; data_index[17] = ctrl.r_srd; data_index[18] = ctrl.l_srd; - data_index[19] = ar.max_limit; - a.loader.belt_move = data_index[20]; - a.loader.drum_turn = data_index[21]; - a.loader.load = data_index[22]; - a.valve1 = data_index[23]; - a.valve2 = data_index[24]; - a.valve3 = data_index[25]; + } void AlphaPool::reset(){ for(int t = 0; t < 10; t++) ctrl.all_data[t] = 0; - a.all_data[0] = 0; - ar.all_data[0] = 0; } \ No newline at end of file
diff -r 2c82568e1790 -r 51a5a9f66f61 AlphaPool.h --- a/AlphaPool.h Wed Aug 30 05:14:05 2017 +0000 +++ b/AlphaPool.h Fri Sep 08 03:27:55 2017 +0000 @@ -43,37 +43,7 @@ i2c_jusinkun_data ctrl; - union i2c_johanshin_data - { - char all_data[1]; - struct - { - unsigned int shot_power :1; - struct - { - unsigned int belt_move :1; - unsigned int drum_turn :1; - unsigned int load :1; - }loader; - - unsigned int valve1 :1; - unsigned int valve2 :1; - unsigned int valve3 :1; - }; - }; //apper_body - i2c_johanshin_data a; - - union i2c_johanshin_return - { - char all_data[1]; - struct - { - unsigned int max_limit :1; - }; - }; //apper_body_return - i2c_johanshin_return ar; - - int data_index[26]; + int data_index[19]; };
diff -r 2c82568e1790 -r 51a5a9f66f61 AlphaTransporter.cpp --- a/AlphaTransporter.cpp Wed Aug 30 05:14:05 2017 +0000 +++ b/AlphaTransporter.cpp Fri Sep 08 03:27:55 2017 +0000 @@ -1,10 +1,9 @@ #include "AlphaTransporter.h" -AlphaTransporter::AlphaTransporter() +AlphaTransporter::AlphaTransporter(I2C *master) : pool(), - i2c(SDA,SCL) + i2c(master) { - } bool AlphaTransporter::set() @@ -14,15 +13,7 @@ i2c.transport_begin(JUSHINKUN_ADDR, pool.ctrl.all_data, 10); no_error = no_error & i2c.read(); i2c.transport_end(); - - i2c.transport_begin(APPER_BODY_ADDR, pool.a.all_data, 1); - no_error = no_error & i2c.write(); - i2c.transport_end(); - - i2c.transport_begin(APPER_BODY_ADDR, pool.ar.all_data, 1); - no_error = no_error & i2c.read(); - i2c.transport_end(); - + pool.up_load(); return no_error;
diff -r 2c82568e1790 -r 51a5a9f66f61 AlphaTransporter.h --- a/AlphaTransporter.h Wed Aug 30 05:14:05 2017 +0000 +++ b/AlphaTransporter.h Fri Sep 08 03:27:55 2017 +0000 @@ -14,10 +14,6 @@ #define JUSHINKUN_ADDR 0x12 #endif -#ifndef APPER_BODY_ADDR -#define APPER_BODY_ADDR 0x0b -#endif - #ifndef ALPHA_TRANSPORTER_H #define ALPHA_TRANSPORTER_H @@ -28,7 +24,7 @@ class AlphaTransporter : public DataPool { public: - AlphaTransporter(); + AlphaTransporter(I2C *master); virtual bool set(); virtual void write(int index_num, int data);