From ae946c109acfb4b03103841d52aeef9cb72e4cdf Mon Sep 17 00:00:00 2001 From: WickedJack99 Date: Thu, 28 Apr 2022 10:18:35 +0200 Subject: [PATCH] Changed name of eeprom to PROGRAMMEMORY, ReadEepromFile to ReadProgramFile --- bin/Control/MyControlModel.class | Bin 10127 -> 10086 bytes bin/Control/MyControlView.class | Bin 10939 -> 10953 bytes .../InformationConnecter.class | Bin 7434 -> 0 bytes ...EepromFile.class => ReadProgramFile.class} | Bin 4748 -> 4765 bytes bin/Model/Microcontroller/ALU.class | Bin 3353 -> 3353 bytes bin/Model/Microcontroller/PIC.class | Bin 12994 -> 13015 bytes .../{EEPROM.class => PROGRAMMEMORY.class} | Bin 1624 -> 1645 bytes bin/Model/Microcontroller/RUNTIMER.class | Bin 2027 -> 2184 bytes bin/Model/MyModel.class | Bin 4218 -> 4287 bytes bin/View/GUIMenuBar.class | Bin 9613 -> 9614 bytes src/Control/MyControlModel.java | 12 +- src/Control/MyControlView.java | 2 +- .../InformationConnecter.java | 158 ------ ...adEepromFile.java => ReadProgramFile.java} | 472 +++++++++--------- src/Model/Microcontroller/ALU.java | 14 +- src/Model/Microcontroller/PIC.java | 9 +- .../{EEPROM.java => PROGRAMMEMORY.java} | 226 ++++----- src/Model/Microcontroller/RUNTIMER.java | 8 + src/Model/MyModel.java | 3 +- src/View/GUIMenuBar.java | 4 +- 20 files changed, 388 insertions(+), 520 deletions(-) delete mode 100644 bin/Model/BackendCommandProcessing/InformationConnecter.class rename bin/Model/EepromLoader/{ReadEepromFile.class => ReadProgramFile.class} (86%) rename bin/Model/Microcontroller/{EEPROM.class => PROGRAMMEMORY.class} (80%) delete mode 100755 src/Model/BackendCommandProcessing/InformationConnecter.java rename src/Model/EepromLoader/{ReadEepromFile.java => ReadProgramFile.java} (97%) mode change 100755 => 100644 rename src/Model/Microcontroller/{EEPROM.java => PROGRAMMEMORY.java} (92%) mode change 100755 => 100644 diff --git a/bin/Control/MyControlModel.class b/bin/Control/MyControlModel.class index 8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CjuJqw@*buuCoxmGfLY2#`16&1%u&9^eC0Y8C_kW3jX;qa zg%WiHO4WFjt7)iE$78XYizVtks8oyafLekobvah5D^a61p;mnuZq<)Ebv+(Zx1mAR z;ZgUYSv`Oj^%#8WYiLv7MZ0-h`W-f?-($1Qjx9DPw%QWV zWgCeETROI}G(_3KqlPxpCVt{W2PrHAXs^1J`YDkV7VJ8&$)8BYIbM@LQw)pzDTnHm zGu-KPjvYNf(G+GU{+LSQOMr!;0dh+cWgX<$(zPHZga2Do zQu3B8j@xj*v*4my!63jMOiuB>O++n6<%B zc?^bzy3Ejvp@X&rBjte<68T^0Z*6Z{L_>L#Kh1M}hT^e%UW{e^5) z@Eux-eN@Aj<|-T@FJF=!FsKVJlFsdJ9HJNaKJ3LS^ai&laO5XJ=;WXv@f3zjyyT#H zZ2c9Vu+_zu6a>`E)@9Qx1*xOk2FOXOJ&|3e4*VR!y6_`Q63d>TL%(zE9TQlK|Kqke N_;czCkFDU-{{Yrq5h(xw diff --git a/bin/Control/MyControlView.class b/bin/Control/MyControlView.class index 96c37ceeda5cd84d1cb41c88976a648c9f3903af..963c3ef0d657c1e8c8686e7742510a4b14f28caa 100644 GIT binary patch delta 62 zcmdlTdNOo_BR`}1f?m>>ezOKIhL6O#6jNy!t?2HkN49b%ivWxMe$ZqcB HHZx;u1(BR`|ULH@qhT#Vt2k?f2Sj0`f97qW}7L4-F?=QolD08dK{ Av;Y7A diff --git a/bin/Model/BackendCommandProcessing/InformationConnecter.class b/bin/Model/BackendCommandProcessing/InformationConnecter.class deleted file mode 100644 index 82cd5005df732d53a120465d1ed6b42876add587..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7434 zcmbVQ3w%@M75{&^H_1(Mp`oFr<<;lPd2f63`&;L8$ zIp_QCch9}geRA}1083fi3yAwSW0=tUHoa zP{v?v@_U+{R+M54Pql)ftol@MHLE#etcr0MPsIxL_ENS_$dw{`h_bzP0o6xThmNKYi5>T=P)?j-FuDrEIq z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%h1q zCB2}rt@=wCttfv%qt`L!VNLv{jihF_f?nyk*>TJBEJ)G__J-vsTSd}H zcEWN$TTN1l!DzXab&_N^lv{SQb4VIxm|@w@){su(gE|wY$HkIZ6Rrr{J!a4`YNyj zlZ}e$Ci*t8g7*0~D)1pJ{1{d<=Cit!C}ng1gT{~W!7_FdCG?r(v;DsFnVGuJ|B-Jx PmrbL$bQYs<4Xo$Cr6ff$?3=9mm3~SjLm>3z9CJKnN1r+6{7bQ;Axxl32gWzwLVtmcUqOPIo zGueff$?3=9mm3~SjLm>3xpCklwOx~3Ks0ExOSkN^Mx diff --git a/bin/Model/Microcontroller/ALU.class b/bin/Model/Microcontroller/ALU.class index f28782d8b3fcda83122abd1a0359202571c66630..b65215d05465e74ffa4e217e9c02d004f4c3553a 100644 GIT binary patch delta 35 pcmbO!HB)Ls6VK%RJYth)@TfC3Og_M4!`J~NMcGXl7#NrsOaa=#3IYHC delta 39 tcmbO!HB)Ls6Axp_{3IGWX3n2gi diff --git a/bin/Model/Microcontroller/PIC.class b/bin/Model/Microcontroller/PIC.class index 9b667304703c53b060a59ee3ac899153a077f534..c63deae7b38a4e476c3e3af8a83dbc541d4dcd47 100644 GIT binary patch delta 418 zcmZ9HPe{{o7{;Hu=Y@5cf2OVmqN{C8bHB~aL_2IWVhx1fHfE74nqxBDA-w3(a|k9V zUpiqZqeAv2XvG`R;T>k|r8T8jpz{dM|Sk?3^c=#IaT*qZ@ zAjvnl!A<12g#m7($hR2fJB;x??(qXAxr-U@sh!~0@V?$V(1vel;UQZ20|EZjyT8!I z-`aG9H2-K*1qJ@a5RcX8(6hQ~*rWyysfA1G;g*KeA6|5njb@0raYin{E*>F1;sQg&lgo6FWlDE1&(MVz)IZLEWXmpJV&Ik-N3p3l>>A76`))>~Z-Dv{(!HqAGU z;n4S<6RRcbL9p1Dv|_Qil}()Y$YQ5-7TX4p!a>+M1Sdz}=BP@PxYVV$-x!DRGcq^< z2PaX$Dfl^!AZK8579oB?gkRCldBpim%^BB$AG+~V(@V(bGD^9E7hFXx*U-#$M7e=? z{Dl}d@qydu<8OT84u-jlG4829Wrw~)y?3My$H?Jdl<*W@{?of>DCfC0T_DU$ZMs4S zZ_veCb^dh0mWC901iPfeDR#Ie^X|jevu-0BA~{HvT%<`J9!ox+NRcKyC=@RYF;F38 zcqu-Z;#V=>K_H+TK{(_UvZNZhV!|Ue@Jbz?O9++nTGL@vNfVkRf>vokT%vd{ZRnM^ I>Z8BoKS()X3IG5A diff --git a/bin/Model/Microcontroller/EEPROM.class b/bin/Model/Microcontroller/PROGRAMMEMORY.class similarity index 80% rename from bin/Model/Microcontroller/EEPROM.class rename to bin/Model/Microcontroller/PROGRAMMEMORY.class index 9ea46326295ba7ecb7b5d2f5627b2d396916547b..900c1b92f4ac1448acfb1105eb892d29a5f766e9 100644 GIT binary patch delta 85 zcmcb?^Oi^8)W2Q(7#J9A8O+!jm>3z9Cklx11_b%L2RZusy88MDMNZV&%B1RpA-wUw PJtLnGiptHdOu{SxBor7g delta 65 zcmaFMbAw0V)W2Q(7#J9A8O+!jm>3ykCJKnLxw-}f`TI^Z-pVBBgWzxGWwd8x=Y~jb Jj$#sK0RUKI5VrsT diff --git a/bin/Model/Microcontroller/RUNTIMER.class b/bin/Model/Microcontroller/RUNTIMER.class index 61997c04190f611cb9e8e3e1742563bf830edd82..6d5ea5db7a2d943b259ac35105036af4a401e1be 100644 GIT binary patch delta 193 zcmaFO-yz6#>ff$?3=9mm3@IDAdYHvIQ}Ys&a#F)xLKqpiQZkF7oXJy|6BxNRe`Ws2 zTra}F$RG&RV#2@#WHB(XX|Zf&klYAlF)^qDNiHDGz)--z%23Fl24wL-R57SCXaISP d42cYwCNN_$p#*3`DW(ZrKqHcX1~D-t0|0$n8(jbZ delta 36 scmeAWe9g~w>ff$?3=9mm3`rZgdYC7#XO3g!*v!ZBk(rf&fr%jz0P7D5lmGw# diff --git a/bin/Model/MyModel.class b/bin/Model/MyModel.class index d75f75335e66cb8af587c226e10d26f02fbaf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ZzO8y9eq6DKjp)l&cl^jqm7IwD77#DqDDg;U${(Zq$Euymi9xIU%(W)yPw wKTziJ#Dm|m6ddDc`#AD(0!wg`xr^~|4&DK4!xSuV93%KDniXxymxRew{)*v{wfRGRxG0>rDK7uLdsjUZ84B@zfmkH^5za_mw;1y&Ll70Te zUIWKIzq?sexsekBugRDx5Y&8$+@<_dWn&`(ugi$VuLZPVO@+$>UC*>Q%pQyhoYsph zYuP+2Fs?UQ8cgR28)V=5uNLe2Noeg=H6pW3w(enz1r%qOyVPfkMW7_v393i5>Q}K;lhkS6fylz>jODg1U|=A zLK1KBq+fHl`#QPDfFxpTV}k@SFYpBx^j+%qtm^__Vz0sYo^H24*jM2VYW|SBL&ewl zR>3#=1$9%_4SYwiano{5U#(BmT4cQnNvsP$2;97UOC2L&MFJ1de1vB7A(7cO>U7Rv zTMR|lQ58dV6glkYOfjR>cZWYV%q-hjidmj!xy>=blEu=@;=6=edwmRzPE!OQsHL}al@{OR} zXh)iyS~$8xs`HF5kBT()d>l$(uUosr62or=J=;+$b?%lKmbG!wr_D%mhZ z1yo4IeB)Q)5hnC^6zE!#E9}B7O7R=YcxD&=Km~4LH~vBu7Ew(qYA6YN$d3KwKpoTn z3}vH%oOqn_agYkoLWR(1CtAscLsW)#szL|V!$VEz;-dP#0gk%64@BWLl}u8cNnD&-1Na_6W0Ue1r#lPJ#q~SE~ e#~G&ZEI-KcyWo{9!Gj$o_>oZ(kDubb{rnF;eq}}g diff --git a/bin/View/GUIMenuBar.class b/bin/View/GUIMenuBar.class index febde2379c830aa79cd6f71e3da6e6c3a9fb2499..e76feb3b1660cf4f39f9bee7438d2a0006f5e46c 100644 GIT binary patch delta 22 ecmeD6?(?2-fKg@QK?$~iqWtut#EtjXs{jCK2?=BX delta 21 dcmeD4?)9E qCommandsForModel; ConcurrentLinkedQueue qDataForModel; - ReadEepromFile oRef; + ReadProgramFile oRef; int iTestFileLoaded = 0; boolean[] abBreakpoints; PIC oPIC; @@ -82,7 +82,7 @@ public class MyControlModel implements ActionListener { if (iResponse == JFileChooser.APPROVE_OPTION) { oFile = new File(oFileChooser.getSelectedFile().getAbsolutePath()); //System.out.println(oFile); - oRef = new ReadEepromFile(); + oRef = new ReadProgramFile(); oRef.setData(oFile); oRef.setOPCode(oRef.getData()); oMyView.getGUITestFileTable().setData(oRef.getData()); @@ -193,7 +193,11 @@ public class MyControlModel implements ActionListener { //WDT-Enabled Checkbox if (e.getSource() == oWDTEnabled) { //Enable/disable watchdog - System.out.println("Watchdog got set to " + oWDTEnabled.isSelected());//TODO + if (oWDTEnabled.isSelected()) { + oPIC.getRuntimer().enableWDT(); + } else { + oPIC.getRuntimer().disableWDT(); + } } //Quarzfrequency diff --git a/src/Control/MyControlView.java b/src/Control/MyControlView.java index 5baf638..3915abf 100644 --- a/src/Control/MyControlView.java +++ b/src/Control/MyControlView.java @@ -226,7 +226,7 @@ public class MyControlView { } } - public void showEEInterruptPrompt() { //TODO + public void showEEInterruptPrompt() { if (oPIC.getRam().get_GIE() && oPIC.getRam().get_EEIE() && oPIC.getRam().get_EEIF()) { Object[] options = {"Ok"}; JOptionPane.showOptionDialog(new JFrame(),asPromptDialogs[1][oMyView.getLanguage()], asPromptTitle[1][oMyView.getLanguage()], JOptionPane.YES_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[1]); diff --git a/src/Model/BackendCommandProcessing/InformationConnecter.java b/src/Model/BackendCommandProcessing/InformationConnecter.java deleted file mode 100755 index 0c74a2d..0000000 --- a/src/Model/BackendCommandProcessing/InformationConnecter.java +++ /dev/null @@ -1,158 +0,0 @@ -package Model.BackendCommandProcessing; - -import Model.Microcontroller.PIC; - -public class InformationConnecter { - - public String connectInformation (PIC oPic, int iActualLine, int iLastLine, int iSetBreakpoint, int iResetBreakpoint, long liRuntime, long liWatchdog) { - - String sConnectedInformation = ""; - - for (int i = 0; i < 128; i++) { - sConnectedInformation.concat("FREG " + i + "," + oPic.getRam().get_Value_Of_Bank_RP0_Bit_Of_Element_At_Adress(false, i) + "\n"); - } - int j = 0; - for (int i = 128; i < 256; i++) { - sConnectedInformation.concat("FREG " + i + "," + oPic.getRam().get_Value_Of_Bank_RP0_Bit_Of_Element_At_Adress(true, j) + "\n"); - j++; - } - sConnectedInformation.concat("SETLINE " + iActualLine + "\n"); - if (iLastLine != iActualLine) - { - sConnectedInformation.concat("RESLINE " + iLastLine + "\n"); - } - sConnectedInformation.concat("TIME " + (liRuntime / 100) + " µs\n"); - sConnectedInformation.concat("WReg " + oPic.get_WRegister() + "\n"); - sConnectedInformation.concat("PCL " + oPic.getRam().get_PCL() + "\n"); - sConnectedInformation.concat("PCLATH " + oPic.getRam().get_PCLATH() + "\n"); - sConnectedInformation.concat("PCINTERN " + oPic.getRam().get_Programcounter() + "\n"); - sConnectedInformation.concat("STATUS " + oPic.getRam().get_STATUS() + "\n"); - sConnectedInformation.concat("FSR " + oPic.getRam().get_FSR() + "\n"); - sConnectedInformation.concat("OPTION " + 1 + "\n"); - - //Statusbits - int sC = oPic.getRam().get_Carryflag()? 1:0; - int sDC = oPic.getRam().get_Digitcarryflag()? 1:0; - int sZ = oPic.getRam().get_Zeroflag()? 1:0; - int sPD = oPic.getRam().get_PowerDownFlag()? 1:0; - int sTO = oPic.getRam().get_TimeOutFlag()? 1:0; - int sRP0 = oPic.getRam().get_RP0Bit()? 1:0; - int sRP1 = oPic.getRam().get_RP1Bit()? 1:0; - int sIRP = oPic.getRam().get_Interruptflag()? 1:0; - - //Set Statusbits in frontend. - sConnectedInformation.concat("STATUSBIT " + 0 + ", " + sC + "\n"); - sConnectedInformation.concat("STATUSBIT " + 1 + ", " + sDC + "\n"); - sConnectedInformation.concat("STATUSBIT " + 2 + ", " + sZ + "\n"); - sConnectedInformation.concat("STATUSBIT " + 3 + ", " + sPD + "\n"); - sConnectedInformation.concat("STATUSBIT " + 4 + ", " + sTO + "\n"); - sConnectedInformation.concat("STATUSBIT " + 5 + ", " + sRP0 + "\n"); - sConnectedInformation.concat("STATUSBIT " + 6 + ", " + sRP1 + "\n"); - sConnectedInformation.concat("STATUSBIT " + 7 + ", " + sIRP + "\n"); - - //Optionbits - int oPS0 = oPic.getRam().get_PS0()? 1:0; - int oPS1 = oPic.getRam().get_PS1()? 1:0; - int oPS2 = oPic.getRam().get_PS2()? 1:0; - int oPSA = oPic.getRam().get_PSA()? 1:0; - int oTSE = oPic.getRam().get_T0SE()? 1:0; - int oTCS = oPic.getRam().get_T0CS()? 1:0; - int oIEG = oPic.getRam().get_INTEDG()? 1:0; - int oRPU = oPic.getRam().get_RBPU()? 1:0; - - //Set Optionbits in frontend. - sConnectedInformation.concat("OPTIONBIT " + 0 + ", " + oPS0 + "\n"); - sConnectedInformation.concat("OPTIONBIT " + 1 + ", " + oPS1 + "\n"); - sConnectedInformation.concat("OPTIONBIT " + 2 + ", " + oPS2 + "\n"); - sConnectedInformation.concat("OPTIONBIT " + 3 + ", " + oPSA + "\n"); - sConnectedInformation.concat("OPTIONBIT " + 4 + ", " + oTSE + "\n"); - sConnectedInformation.concat("OPTIONBIT " + 5 + ", " + oTCS + "\n"); - sConnectedInformation.concat("OPTIONBIT " + 6 + ", " + oIEG + "\n"); - sConnectedInformation.concat("OPTIONBIT " + 7 + ", " + oRPU + "\n"); - - //Intconbits - int iRIF = oPic.getRam().get_RBIF()? 1:0; - int iIF = oPic.getRam().get_INTF()? 1:0; - int iTIF = oPic.getRam().get_T0IF()? 1:0; - int iRIE = oPic.getRam().get_RBIE()? 1:0; - int iIE = oPic.getRam().get_INTE()? 1:0; - int iTIE = oPic.getRam().get_T0IE()? 1:0; - int iEIE = oPic.getRam().get_EEIE()? 1:0; - int iGIE = oPic.getRam().get_GIE()? 1:0; - - //Set Intconbits in frontend. - sConnectedInformation.concat("INTCONBIT " + 0 + ", " + iRIF + "\n"); - sConnectedInformation.concat("INTCONBIT " + 1 + ", " + iIF + "\n"); - sConnectedInformation.concat("INTCONBIT " + 2 + ", " + iTIF + "\n"); - sConnectedInformation.concat("INTCONBIT " + 3 + ", " + iRIE + "\n"); - sConnectedInformation.concat("INTCONBIT " + 4 + "," + iIE + "\n"); - sConnectedInformation.concat("INTCONBIT " + 5 + ", " + iTIE + "\n"); - sConnectedInformation.concat("INTCONBIT " + 6 + ", " + iEIE + "\n"); - sConnectedInformation.concat("INTCONBIT " + 7 + ", " + iGIE + "\n"); - - //TRISA in frontend is set. - sConnectedInformation.concat("TRISA " + 0 + "," + ((oPic.getRam().get_TRISA() & 0b00000001) >> 0) + "\n"); //For better understanding - sConnectedInformation.concat("TRISA " + 1 + "," + ((oPic.getRam().get_TRISA() & 0b00000010) >> 1) + "\n"); - sConnectedInformation.concat("TRISA " + 2 + "," + ((oPic.getRam().get_TRISA() & 0b00000100) >> 2) + "\n"); - sConnectedInformation.concat("TRISA " + 3 + "," + ((oPic.getRam().get_TRISA() & 0b00001000) >> 3) + "\n"); - sConnectedInformation.concat("TRISA " + 4 + "," + ((oPic.getRam().get_TRISA() & 0b00010000) >> 4) + "\n"); - sConnectedInformation.concat("TRISA " + 5 + "," + ((oPic.getRam().get_TRISA() & 0b00100000) >> 5) + "\n"); - sConnectedInformation.concat("TRISA " + 6 + "," + ((oPic.getRam().get_TRISA() & 0b01000000) >> 6) + "\n"); - sConnectedInformation.concat("TRISA " + 7 + "," + ((oPic.getRam().get_TRISA() & 0b10000000) >> 7) + "\n"); - - //PORTA in frontend is set. - sConnectedInformation.concat("PORTA " + 0 + "," + ((oPic.getRam().get_PORTA() & 0b00001) >> 0) + "\n"); //For better understanding - sConnectedInformation.concat("PORTA " + 1 + "," + ((oPic.getRam().get_PORTA() & 0b00010) >> 1) + "\n"); - sConnectedInformation.concat("PORTA " + 2 + "," + ((oPic.getRam().get_PORTA() & 0b00100) >> 2) + "\n"); - sConnectedInformation.concat("PORTA " + 3 + "," + ((oPic.getRam().get_PORTA() & 0b01000) >> 3) + "\n"); - sConnectedInformation.concat("PORTA " + 4 + "," + ((oPic.getRam().get_PORTA() & 0b10000) >> 4) + "\n"); - - //TRISB in frontend is set. - sConnectedInformation.concat("TRISB " + 0 + "," + ((oPic.getRam().get_TRISB() & 0b00000001) >> 0) + "\n"); //For better understanding - sConnectedInformation.concat("TRISB " + 1 + "," + ((oPic.getRam().get_TRISB() & 0b00000010) >> 1) + "\n"); - sConnectedInformation.concat("TRISB " + 2 + "," + ((oPic.getRam().get_TRISB() & 0b00000100) >> 2) + "\n"); - sConnectedInformation.concat("TRISB " + 3 + "," + ((oPic.getRam().get_TRISB() & 0b00001000) >> 3) + "\n"); - sConnectedInformation.concat("TRISB " + 4 + "," + ((oPic.getRam().get_TRISB() & 0b00010000) >> 4) + "\n"); - sConnectedInformation.concat("TRISB " + 5 + "," + ((oPic.getRam().get_TRISB() & 0b00100000) >> 5) + "\n"); - sConnectedInformation.concat("TRISB " + 6 + "," + ((oPic.getRam().get_TRISB() & 0b01000000) >> 6) + "\n"); - sConnectedInformation.concat("TRISB " + 7 + "," + ((oPic.getRam().get_TRISB() & 0b10000000) >> 7) + "\n"); - - //PORTB in frontend is set. - sConnectedInformation.concat("PORTB " + 0 + "," + ((oPic.getRam().get_PORTB() & 0b00000001) >> 0) + "\n"); //For better understandin - sConnectedInformation.concat("PORTB " + 1 + "," + ((oPic.getRam().get_PORTB() & 0b00000010) >> 1) + "\n"); - sConnectedInformation.concat("PORTB " + 2 + "," + ((oPic.getRam().get_PORTB() & 0b00000100) >> 2) + "\n"); - sConnectedInformation.concat("PORTB " + 3 + "," + ((oPic.getRam().get_PORTB() & 0b00001000) >> 3) + "\n"); - sConnectedInformation.concat("PORTB " + 4 + "," + ((oPic.getRam().get_PORTB() & 0b00010000) >> 4) + "\n"); - sConnectedInformation.concat("PORTB " + 5 + "," + ((oPic.getRam().get_PORTB() & 0b00100000) >> 5) + "\n"); - sConnectedInformation.concat("PORTB " + 6 + "," + ((oPic.getRam().get_PORTB() & 0b01000000) >> 6) + "\n"); - sConnectedInformation.concat("PORTB " + 7 + "," + ((oPic.getRam().get_PORTB() & 0b10000000) >> 7) + "\n"); - - //STACK in frontend is set. - sConnectedInformation.concat("STACK " + oPic.getStack().getSTACK()[0] + "," - + oPic.getStack().getSTACK()[1] + "," - + oPic.getStack().getSTACK()[2] + "," - + oPic.getStack().getSTACK()[3] + "," - + oPic.getStack().getSTACK()[4] + "," - + oPic.getStack().getSTACK()[5] + "," - + oPic.getStack().getSTACK()[6] + "," - + oPic.getStack().getSTACK()[7] + "\n"); - - //TIMER0 - sConnectedInformation.concat("TIMER0 " + oPic.getRam().get_TMR0() + "\n"); - - //Watchdog in frontend is set. (Doesn't work correctly since watchdog isn't implemented correctly) TODO - sConnectedInformation.concat("WATCHDOG " + liWatchdog + "\n"); - sConnectedInformation.concat("PRESCALER " + 1 + ":" + oPic.getRam().get_TMR0_PrescalerRate() + "\n"); - - if (iSetBreakpoint > -1) - sConnectedInformation.concat("SETBREAK " + iSetBreakpoint + "\n"); - - if (iResetBreakpoint > -1) - sConnectedInformation.concat("RESBREAK " + iResetBreakpoint + "\n"); - else if (iResetBreakpoint == -2) { - sConnectedInformation.concat("RESALLBREAK"); //TODO \n if new string concated - } - - return sConnectedInformation; - } -} diff --git a/src/Model/EepromLoader/ReadEepromFile.java b/src/Model/EepromLoader/ReadProgramFile.java old mode 100755 new mode 100644 similarity index 97% rename from src/Model/EepromLoader/ReadEepromFile.java rename to src/Model/EepromLoader/ReadProgramFile.java index 43d21a4..87cbc10 --- a/src/Model/EepromLoader/ReadEepromFile.java +++ b/src/Model/EepromLoader/ReadProgramFile.java @@ -1,236 +1,236 @@ -package Model.EepromLoader; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; - -import Model.Microcontroller.PIC; - -public class ReadEepromFile { - - ArrayList dataLines; - ArrayList oPCode; - /** - * Get OP-Code out of String-data-array. - * @param dataArray String-array where OP-Code is. - * @return String-array with only OP-Code. - */ - public void setOPCode(ArrayList data) { - - oPCode = new ArrayList(); - - for (int i = 0; i < data.size(); i++) { - //If element in dataArray at position i is null or a space, this element is not added into the new oPCode-Array. - if (data.get(i) != null && data.get(i).charAt(0) != 32) { - oPCode.add(data.get(i)); - } - } - } - - public ArrayList getOPCode() { - return oPCode; - } - - /** - * Gets whole data of the file. - * @param file - * @throws IOException - */ - public void setData(File file) { - //Creates String-arraylist with whole data. - dataLines = new ArrayList(); - - try { - FileReader fR = new FileReader(file); - BufferedReader br = new BufferedReader(fR); - - String sLine; - while ((sLine = br.readLine()) != null) { - dataLines.add(sLine); - } - - br.close(); - - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * @return ArrayList dataLines from current this object. - */ - public ArrayList getData() { - return dataLines; - } - - /** - * Turns hex-values of an overhanded String-array into an int-array with decimal-values. - * [0] = memoryCountIndex - * [1] = commandAsInt - * [2] = dataLineRepresentationIndex - * @param oPCode String-array - * @return int-array - */ - public int[][] getOPCodeArrayCommandAsInt(ArrayList oPCode) { - int[][] aiReturnArray = new int[oPCode.size()][3]; - - for (int i = 0; i < oPCode.size(); i++) { - for (int k = 0; k < dataLines.size(); k++) - if (oPCode.get(i).equals(dataLines.get(k))) { - aiReturnArray[i][2] = k; - } - } - - for (int indexRowOPCode = 0; indexRowOPCode < oPCode.size(); indexRowOPCode++) { - int indexOPCode = 0; - int commandAsInt = 0; - int memoryCount = 0; - - //Stops if second space is reached. (After command is read.) - while (indexOPCode < 9) { - switch (indexOPCode) { - case 0: { - memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 0, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); - }break; - - case 1: { - memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 1, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); - }break; - - case 2: { - memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 2, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); - }break; - - case 3: { - memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 3, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); - }break; - - case 5: { - commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 5, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); - }break; - - case 6: { - commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 6, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); - }break; - - case 7: { - commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 7, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); - }break; - - case 8: { - commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 8, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); - }break; - } - - //Increase location which will be checked by one. - indexOPCode++; - } - aiReturnArray[indexRowOPCode][0] = memoryCount; - aiReturnArray[indexRowOPCode][1] = commandAsInt; - } - return aiReturnArray; - } - - /** - * @param iCase Location of the actually checked character. - * @param iIndexRowOPCode Actual row of oPCode. - * @param iMemoryCount - * @param iCommandAsInt - * @return Int-Array with memoryCount [0] and commmandAsInt [1]. - */ - public int[] getOPCodeArrayCommandAsIntSubFunction(ArrayList oPCode, int iCase, int iIndexRowOPCode, int iIndexOPCode, int iMemoryCount, int iCommandAsInt) { - - int[] aiCaseArray = {4096, 256, 16, 1, 0, 4096, 256, 16, 1}; - int[] aiResultArray = new int[2]; - - int iMemoryCountReturn = iMemoryCount; - int iCommandAsIntReturn = iCommandAsInt; - - switch (iCase) { - //0123 0 == 4096 1 == 256 2 == 16 3 == 1 - //0(Ascii: 48) 1(49) ... 9(57) / A(Ascii: 65) B(66) ... F(70) - //Checks first four characters of one line of the simulation-file which are hex-represented-characters(0-F) - //These characters are converted into integer-representation to process further. - case 0: //Fallthrough is wanted - case 1: //Fallthrough is wanted - case 2: //Fallthrough is wanted - case 3: { - //0-9 - if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 47 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 58) { - iMemoryCountReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 48) * aiCaseArray[iCase]; - } - - //A-F - else if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 64 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 71) { - iMemoryCountReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 55) * aiCaseArray[iCase]; - } - - //Else - else { - System.out.println("Expected value between 48 and 57 or 65 and 70 but was " + oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode)); - } - }break; - - //Checks 5th, 6th, 7th, 8th character of one line of the simulation-file which are hex-represented-characters(0-F) - //These characters are converted into integer-representation to process further. - case 5: //Fallthrough is wanted - case 6: //Fallthrough is wanted - case 7: //Fallthrough is wanted - case 8: { - //0-9 - if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 47 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 58) { - iCommandAsIntReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 48) * aiCaseArray[iCase]; - } - - //A-F - else if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 64 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 71) { - iCommandAsIntReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 55) * aiCaseArray[iCase]; - } - - //Else - else { - System.out.println("Expected value between 48 and 57 or 65 and 70 but was " + oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode)); - } - }break; - } - - aiResultArray[0] = iMemoryCountReturn; - aiResultArray[1] = iCommandAsIntReturn; - - return aiResultArray; - } - - /** - * Reads file and writes instructions to EEPROM. - * @param files String-Array with paths of files. - * @param k index of file in String-Array "files". - * @param oPIC of the main-function. - */ - public void readFileAndWriteToEEPROM(PIC oPIC) { - if (oPCode.size() > 0) { - //Integer-array which will contain oPCode as int-values. - //Get an twodimensional array with int-values. - int[][] oPCodeAsInt = getOPCodeArrayCommandAsInt(oPCode); - - //asCommands are written into EEPROM - for (int i = 0; i < oPCodeAsInt.length; i++) { - //The adress where the command will be written in the EEPROM - int memoryAdress = oPCodeAsInt[i][0]; - //System.out.println(memoryAdress); - - //Command that will be written into the EEPROM - int command = oPCodeAsInt[i][1]; - //System.out.println(command); - - int iIndex = oPCodeAsInt[i][2]; - - //asCommands are written into EEPROM - oPIC.getEeprom().setElementXToValueY(memoryAdress, command); - - oPIC.getEeprom().setElementXToIndexY(memoryAdress, iIndex); - } - } - } -} +package Model.EepromLoader; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; + +import Model.Microcontroller.PIC; + +public class ReadProgramFile { + + ArrayList dataLines; + ArrayList oPCode; + /** + * Get OP-Code out of String-data-array. + * @param dataArray String-array where OP-Code is. + * @return String-array with only OP-Code. + */ + public void setOPCode(ArrayList data) { + + oPCode = new ArrayList(); + + for (int i = 0; i < data.size(); i++) { + //If element in dataArray at position i is null or a space, this element is not added into the new oPCode-Array. + if (data.get(i) != null && data.get(i).charAt(0) != 32) { + oPCode.add(data.get(i)); + } + } + } + + public ArrayList getOPCode() { + return oPCode; + } + + /** + * Gets whole data of the file. + * @param file + * @throws IOException + */ + public void setData(File file) { + //Creates String-arraylist with whole data. + dataLines = new ArrayList(); + + try { + FileReader fR = new FileReader(file); + BufferedReader br = new BufferedReader(fR); + + String sLine; + while ((sLine = br.readLine()) != null) { + dataLines.add(sLine); + } + + br.close(); + + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * @return ArrayList dataLines from current this object. + */ + public ArrayList getData() { + return dataLines; + } + + /** + * Turns hex-values of an overhanded String-array into an int-array with decimal-values. + * [0] = memoryCountIndex + * [1] = commandAsInt + * [2] = dataLineRepresentationIndex + * @param oPCode String-array + * @return int-array + */ + public int[][] getOPCodeArrayCommandAsInt(ArrayList oPCode) { + int[][] aiReturnArray = new int[oPCode.size()][3]; + + for (int i = 0; i < oPCode.size(); i++) { + for (int k = 0; k < dataLines.size(); k++) + if (oPCode.get(i).equals(dataLines.get(k))) { + aiReturnArray[i][2] = k; + } + } + + for (int indexRowOPCode = 0; indexRowOPCode < oPCode.size(); indexRowOPCode++) { + int indexOPCode = 0; + int commandAsInt = 0; + int memoryCount = 0; + + //Stops if second space is reached. (After command is read.) + while (indexOPCode < 9) { + switch (indexOPCode) { + case 0: { + memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 0, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); + }break; + + case 1: { + memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 1, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); + }break; + + case 2: { + memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 2, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); + }break; + + case 3: { + memoryCount = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 3, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[0]); + }break; + + case 5: { + commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 5, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); + }break; + + case 6: { + commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 6, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); + }break; + + case 7: { + commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 7, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); + }break; + + case 8: { + commandAsInt = (getOPCodeArrayCommandAsIntSubFunction(oPCode, 8, indexRowOPCode, indexOPCode, memoryCount, commandAsInt)[1]); + }break; + } + + //Increase location which will be checked by one. + indexOPCode++; + } + aiReturnArray[indexRowOPCode][0] = memoryCount; + aiReturnArray[indexRowOPCode][1] = commandAsInt; + } + return aiReturnArray; + } + + /** + * @param iCase Location of the actually checked character. + * @param iIndexRowOPCode Actual row of oPCode. + * @param iMemoryCount + * @param iCommandAsInt + * @return Int-Array with memoryCount [0] and commmandAsInt [1]. + */ + public int[] getOPCodeArrayCommandAsIntSubFunction(ArrayList oPCode, int iCase, int iIndexRowOPCode, int iIndexOPCode, int iMemoryCount, int iCommandAsInt) { + + int[] aiCaseArray = {4096, 256, 16, 1, 0, 4096, 256, 16, 1}; + int[] aiResultArray = new int[2]; + + int iMemoryCountReturn = iMemoryCount; + int iCommandAsIntReturn = iCommandAsInt; + + switch (iCase) { + //0123 0 == 4096 1 == 256 2 == 16 3 == 1 + //0(Ascii: 48) 1(49) ... 9(57) / A(Ascii: 65) B(66) ... F(70) + //Checks first four characters of one line of the simulation-file which are hex-represented-characters(0-F) + //These characters are converted into integer-representation to process further. + case 0: //Fallthrough is wanted + case 1: //Fallthrough is wanted + case 2: //Fallthrough is wanted + case 3: { + //0-9 + if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 47 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 58) { + iMemoryCountReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 48) * aiCaseArray[iCase]; + } + + //A-F + else if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 64 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 71) { + iMemoryCountReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 55) * aiCaseArray[iCase]; + } + + //Else + else { + System.out.println("Expected value between 48 and 57 or 65 and 70 but was " + oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode)); + } + }break; + + //Checks 5th, 6th, 7th, 8th character of one line of the simulation-file which are hex-represented-characters(0-F) + //These characters are converted into integer-representation to process further. + case 5: //Fallthrough is wanted + case 6: //Fallthrough is wanted + case 7: //Fallthrough is wanted + case 8: { + //0-9 + if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 47 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 58) { + iCommandAsIntReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 48) * aiCaseArray[iCase]; + } + + //A-F + else if (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) > 64 && oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) < 71) { + iCommandAsIntReturn += (oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode) - 55) * aiCaseArray[iCase]; + } + + //Else + else { + System.out.println("Expected value between 48 and 57 or 65 and 70 but was " + oPCode.get(iIndexRowOPCode).charAt(iIndexOPCode)); + } + }break; + } + + aiResultArray[0] = iMemoryCountReturn; + aiResultArray[1] = iCommandAsIntReturn; + + return aiResultArray; + } + + /** + * Reads file and writes instructions to EEPROM. + * @param files String-Array with paths of files. + * @param k index of file in String-Array "files". + * @param oPIC of the main-function. + */ + public void readFileAndWriteToEEPROM(PIC oPIC) { + if (oPCode.size() > 0) { + //Integer-array which will contain oPCode as int-values. + //Get an twodimensional array with int-values. + int[][] oPCodeAsInt = getOPCodeArrayCommandAsInt(oPCode); + + //asCommands are written into EEPROM + for (int i = 0; i < oPCodeAsInt.length; i++) { + //The adress where the command will be written in the EEPROM + int memoryAdress = oPCodeAsInt[i][0]; + //System.out.println(memoryAdress); + + //Command that will be written into the EEPROM + int command = oPCodeAsInt[i][1]; + //System.out.println(command); + + int iIndex = oPCodeAsInt[i][2]; + + //asCommands are written into EEPROM + oPIC.getEeprom().setElementXToValueY(memoryAdress, command); + + oPIC.getEeprom().setElementXToIndexY(memoryAdress, iIndex); + } + } + } +} diff --git a/src/Model/Microcontroller/ALU.java b/src/Model/Microcontroller/ALU.java index d28e135..1557287 100644 --- a/src/Model/Microcontroller/ALU.java +++ b/src/Model/Microcontroller/ALU.java @@ -23,7 +23,7 @@ public class ALU { } /** - * + * Adds or subtracts iValue1 and iWRegister according to bSubtractionBit. * @param iValue1 * @param iWRegister * @param bSubtractionBit @@ -112,14 +112,26 @@ public class ALU { return iOutcome; } + /** + * + * @returns CarryFlag + */ public boolean getCarryFlag() { return bCarryFlag; } + /** + * + * @returns DigitCarryFlag + */ public boolean getDigitCarryFlag() { return bDigitCarryFlag; } + /** + * + * @returns ZeroFlag + */ public boolean getZeroFlag() { return bZeroFlag; } diff --git a/src/Model/Microcontroller/PIC.java b/src/Model/Microcontroller/PIC.java index 78a6ced..941183c 100755 --- a/src/Model/Microcontroller/PIC.java +++ b/src/Model/Microcontroller/PIC.java @@ -13,7 +13,7 @@ public class PIC { * Parts of PIC. * Objects are written with a large starting letter. */ - private EEPROM Eeprom; + private PROGRAMMEMORY Eeprom; private RAM Ram; private STACK Stack; private int WRegister; @@ -22,7 +22,7 @@ public class PIC { public PIC() { //Initialising objects of PIC. - Eeprom = new EEPROM(); + Eeprom = new PROGRAMMEMORY(); Ram = new RAM(); Stack = new STACK(); Runtimer = new RUNTIMER(Ram); @@ -75,7 +75,7 @@ public class PIC { return Ram; } - public synchronized EEPROM getEeprom() { + public synchronized PROGRAMMEMORY getEeprom() { return Eeprom; } @@ -1156,8 +1156,9 @@ public class PIC { * Section 14.8 for more details. */ public void SLEEP() { - //TODO pause running (no Thread.sleep()!!!) + //pause running (no Thread.sleep()!!!) //Not implemented + //Increment programcounter and TMR0 if assigned to TMR0. Ram.inkrement_Programcounter(1); if (Ram.get_T0CS() == false) { diff --git a/src/Model/Microcontroller/EEPROM.java b/src/Model/Microcontroller/PROGRAMMEMORY.java old mode 100755 new mode 100644 similarity index 92% rename from src/Model/Microcontroller/EEPROM.java rename to src/Model/Microcontroller/PROGRAMMEMORY.java index 2b64e8e..3bd9eca --- a/src/Model/Microcontroller/EEPROM.java +++ b/src/Model/Microcontroller/PROGRAMMEMORY.java @@ -1,113 +1,113 @@ -package Model.Microcontroller; -/** - * @author Aaron Moser - * @date 23.06.2021 - */ - - /** - * Electrical Eraseable Programmable Read Only Memory of the PIC (Programmspeicher) - */ -public class EEPROM -{ - private int[][] eeprom; - private int eepromLength = 1024; - - private int[] aiProgramLines; - - public EEPROM() - { - eeprom = new int[eepromLength][2]; - } - - public EEPROM(int iLength) { - eeprom = new int[iLength][2]; - } - - /** - * Returns array of program lines in data - * @return - */ - public int[] getProgramLines() { - return aiProgramLines; - } - - /** - * Return element i of program lines in data - * @param i - * @return - */ - public int getProgramLine(int i) { - return aiProgramLines[i]; - } - - /** - * Sets program lines of data - * @param aiProgLines - */ - public void setProgramLines(int[] aiProgLines) { - aiProgramLines = aiProgLines; - } - - /** - * Returns element of index element in eeprom-array. - * @param element index of array. - * @return element at index. - */ - public int getElement(int index) { - int returnValue = -1; - if (index >= 0 && index < 1024) { - returnValue = eeprom[index][0]; - } - return returnValue; - } - - /** - * Returns index of line at data lines - * @param iIndex - * @return - */ - public int getIndex(int iIndex) { - int returnValue = -1; - if (iIndex >= 0 && iIndex < 1024) { - returnValue = eeprom[iIndex][1]; - } - return returnValue; - } - - /** - * Returns length of EEPROM - */ - public int getLengthEEPROM() { - return eepromLength; - } - - /** - * Set element to value. - * @param index of element. - * @param value of what the element is set to. - * @return true if set worked. - */ - public boolean setElementXToValueY(int index, int value) { - boolean bSetWorked = false; - if ((index >= 0) && (index < 1024)) { - eeprom[index][0] = value; - bSetWorked = true; - } - return bSetWorked; - } - - /** - * - * @param iElement - * @param iIndex - * @return - */ - public boolean setElementXToIndexY(int iElement, int iIndex) { - boolean bSetWorked = false; - if ((iElement >= 0) && (iElement < 1024)) { - eeprom[iElement][1] = iIndex; - bSetWorked = true; - } - return bSetWorked; - } -} +package Model.Microcontroller; +/** + * @author Aaron Moser + * @date 23.06.2021 + */ + + /** + * Electrical Eraseable Programmable Read Only Memory of the PIC (Programmspeicher) + */ +public class PROGRAMMEMORY +{ + private int[][] eeprom; + private int eepromLength = 1024; + + private int[] aiProgramLines; + + public PROGRAMMEMORY() + { + eeprom = new int[eepromLength][2]; + } + + public PROGRAMMEMORY(int iLength) { + eeprom = new int[iLength][2]; + } + + /** + * Returns array of program lines in data + * @return + */ + public int[] getProgramLines() { + return aiProgramLines; + } + + /** + * Return element i of program lines in data + * @param i + * @return + */ + public int getProgramLine(int i) { + return aiProgramLines[i]; + } + + /** + * Sets program lines of data + * @param aiProgLines + */ + public void setProgramLines(int[] aiProgLines) { + aiProgramLines = aiProgLines; + } + + /** + * Returns element of index element in eeprom-array. + * @param element index of array. + * @return element at index. + */ + public int getElement(int index) { + int returnValue = -1; + if (index >= 0 && index < 1024) { + returnValue = eeprom[index][0]; + } + return returnValue; + } + + /** + * Returns index of line at data lines + * @param iIndex + * @return + */ + public int getIndex(int iIndex) { + int returnValue = -1; + if (iIndex >= 0 && iIndex < 1024) { + returnValue = eeprom[iIndex][1]; + } + return returnValue; + } + + /** + * Returns length of EEPROM + */ + public int getLengthEEPROM() { + return eepromLength; + } + + /** + * Set element to value. + * @param index of element. + * @param value of what the element is set to. + * @return true if set worked. + */ + public boolean setElementXToValueY(int index, int value) { + boolean bSetWorked = false; + if ((index >= 0) && (index < 1024)) { + eeprom[index][0] = value; + bSetWorked = true; + } + return bSetWorked; + } + + /** + * + * @param iElement + * @param iIndex + * @return + */ + public boolean setElementXToIndexY(int iElement, int iIndex) { + boolean bSetWorked = false; + if ((iElement >= 0) && (iElement < 1024)) { + eeprom[iElement][1] = iIndex; + bSetWorked = true; + } + return bSetWorked; + } +} diff --git a/src/Model/Microcontroller/RUNTIMER.java b/src/Model/Microcontroller/RUNTIMER.java index 524fefd..1009afb 100644 --- a/src/Model/Microcontroller/RUNTIMER.java +++ b/src/Model/Microcontroller/RUNTIMER.java @@ -107,4 +107,12 @@ public class RUNTIMER { }break; } } + + public void enableWDT() { + WDTE = true; + } + + public void disableWDT() { + WDTE = false; + } } \ No newline at end of file diff --git a/src/Model/MyModel.java b/src/Model/MyModel.java index 3d04820..67ad768 100644 --- a/src/Model/MyModel.java +++ b/src/Model/MyModel.java @@ -61,7 +61,8 @@ public class MyModel extends Thread { } //Check if interrupt was acknowledged if (oPIC.interruptAcknowledged()) { - //TODO + //Execute ISR + oPIC.InterruptServiceRoutine(); } else { //Check if breakpoints initialized if (abBreakpoints != null) { diff --git a/src/View/GUIMenuBar.java b/src/View/GUIMenuBar.java index 152c1e2..b91c3e2 100644 --- a/src/View/GUIMenuBar.java +++ b/src/View/GUIMenuBar.java @@ -11,14 +11,14 @@ import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; -import Model.EepromLoader.ReadEepromFile; +import Model.EepromLoader.ReadProgramFile; public class GUIMenuBar extends JMenuBar { MyView oMyView; ArrayList oBreakpoints; - ReadEepromFile oRef; + ReadProgramFile oRef; boolean[] bBreakpointSet; ArrayList oMenuItems = new ArrayList();