mfrc522 spi connection via hal library - stm32

I am trying to make connection by HAL_SPI_*() API with mfrc522 and at least read VersionReg register , but what address I want to read return its address in data in other words it seems to has a echo!
Here is my SPI initialisation:
hspi1.Instance = SPI1;
hspi1.Init.Mode = SPI_MODE_MASTER;
hspi1.Init.Direction = SPI_DIRECTION_2LINES;
hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
hspi1.Init.NSS = SPI_NSS_SOFT;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32;
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi1.Init.CRCPolynomial = 7;
if (HAL_SPI_Init(&hspi1) != HAL_OK)
{
Error_Handler();
}
and here is my function to read a register:
HAL_GPIO_WritePin(RD_SS_Port, RD_SS_Pin, GPIO_PIN_RESET);
Address=0x37;
ucAddr = ((Address<<1)&0x7E)|0x80;
// ucAddr=0xb7;
d[0]=ucAddr;
while(HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY) { }
if (HAL_SPI_Transmit(&hspi1,d,2,20) != HAL_OK)
{
printf("send error\r\n");
}
while(HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY) { }
if (HAL_SPI_Receive(&hspi1,r,1,20) != HAL_OK)
{
printf("Receive error\r\n");
}
// printf("i2=%x s[0]=%x r[0]=%x r[1]=%x \r\n",i,s[0],r[0],r[1]);
ucResult=r[0];
return ucResult;
I will appreciate if some one can help me.

Actually the first read is ok and I can read VersionReg once after reset .
but even when I put it in a loop , just the first read is ok(0x92) and the others read (0xee) which is the thing I have sent to it.

Related

Linux i2c touch device driver probe not be called

I try to add focaltech touch driver to my board, the fts_ts_init() is worked, but the ->probe() not be called, I do not why. CONFIG_OF is opened.
Driver code:
static const struct i2c_device_id fts_ts_id[] = {
{FTS_DRIVER_NAME, 0},
{}
};
static const struct of_device_id fts_dt_match[] = {
{.compatible = "focaltech,fts", },
{}
};
MODULE_DEVICE_TABLE(of, fts_dt_match);
static struct i2c_driver fts_ts_driver = {
.probe = fts_ts_probe,
.remove = fts_ts_remove,
.driver = {
.name = FTS_DRIVER_NAME,
.owner = THIS_MODULE,
#if defined(CONFIG_PM) && FTS_PATCH_COMERR_PM
.pm = &fts_dev_pm_ops,
#endif
.of_match_table = of_match_ptr(fts_dt_match),
},
.id_table = fts_ts_id,
};
static int __init fts_ts_init(void)
{
int ret = 0;
FTS_FUNC_ENTER();
ret = i2c_add_driver(&fts_ts_driver);
printk("[FTS_TS] ret=%d\n", ret);
if (ret)
FTS_ERROR("Focaltech touch screen driver init failed!");
FTS_FUNC_EXIT();
return ret;
}
module_init(fts_ts_init);
Device Tree Source:
i2c4: i2c#0x10054000 {
compatible = "ingenic,x2000-i2c";
reg = <0x10054000 0x1000>;
interrupt-parent = <&core_intc>;
interrupts = <IRQ_I2C4>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
focaltech#38{
compatible = "focaltech,fts";
reg = <0x38>;
interrupt-parent = <&gpa>;
interrupts = <3 0x2>;
focaltech,reset-gpio = <&gpa 0 GPIO_ACTIVE_LOW >;
focaltech,irq-gpio = <&gpa 3 0x2 >;
focaltech,max-touch-number = <2>;
focaltech,display-coords = <0 0 800 480>;
status = "okay";
};
};
I try to write the node in /, and use a simple paltform drvier, of_match_table is the same, ->probe() is called.

Error in adding properties my object Server OPC-UA

I am using the open62541 library [1.1.2-216-g50933d8].
Tell me how to add engineering units to my node?
Му Node create:
bool isOk = true;
UA_VariableAttributes valueAttr = UA_VariableAttributes_default;
UA_Variant_init(&valueAttr.value);
UA_Float valueVal = 0;
UA_Variant_setScalar(&valueAttr.value, &valueVal, &UA_TYPES[UA_TYPES_FLOAT]);
std::string description = "Value Params";
valueAttr.description = UA_LOCALIZEDTEXT(const_cast<char*>(lt), const_cast<char*>(description.c_str()));
valueAttr.displayName = UA_LOCALIZEDTEXT(const_cast<char*>(lt), const_cast<char*>("Value"));
if(UA_Server_addVariableNode(server, UA_NODEID_NULL,
getNodeId(),
UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT),
UA_QUALIFIEDNAME(nsIndexBrowser, const_cast<char*>("Value")),
UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE),
valueAttr, nullptr, &value_) != UA_STATUSCODE_GOOD)
{
return isOk;
}
I tried to do this:
UA_EUInformation eu;
eu.namespaceUri = UA_STRING("somecompany.com");
eu.unitId = -1;
eu.displayName = UA_LOCALIZEDTEXT(const_cast<char*>(lt), const_cast<char*>(typeSigne_->getEUid().c_str()));
eu.description = UA_LOCALIZEDTEXT(const_cast<char*>(lt), const_cast<char*>(typeSigne_->getEUid().c_str()));
UA_StatusCode status = UA_Server_writeObjectProperty_scalar(server,
value_,
UA_QUALIFIEDNAME(nsIndexBrowser, "EngineeringUnits"),
&eu,
&UA_TYPES[UA_TYPES_EUINFORMATION]);
if(status != UA_STATUSCODE_GOOD)
{
return isOk;
}
But I got the error code UA_STATUSCODE_BADNOMATCH
I tried to do this:
UA_EUInformation eu;
eu.namespaceUri = UA_STRING("somecompany.com");
eu.unitId = -1;
eu.displayName = UA_LOCALIZEDTEXT(const_cast<char*>(lt), const_cast<char*>(typeSigne_->getEUid().c_str()));
eu.description = UA_LOCALIZEDTEXT(const_cast<char*>(lt), const_cast<char*>(typeSigne_->getEUid().c_str()));
UA_VariableAttributes enAttr = UA_VariableAttributes_default;
UA_VariableAttributes_init(&enAttr);
enAttr.dataType = UA_TYPES[UA_TYPES_EUINFORMATION].typeId;
enAttr.userWriteMask = UA_ACCESSLEVELMASK_READ;
UA_Variant_setScalarCopy(&enAttr.value, &eu, &UA_TYPES[UA_TYPES_EUINFORMATION]);
UA_StatusCode status = UA_Server_addVariableNode(server, UA_NODEID_NULL,
value_,
UA_NODEID_NUMERIC(0, UA_NS0ID_HASPROPERTY),
UA_QUALIFIEDNAME(nsIndexBrowser, "EngineeringUnits"),
UA_NODEID_NUMERIC(0, UA_NS0ID_PROPERTYTYPE),
enAttr,
nullptr, &enUnitNodeUnits_);
if(status != UA_STATUSCODE_GOOD)
{
return isOk;
}
But I got the error code UA_STATUSCODE_BADTYPEMISMATCH
I also tried these examples https://groups.google.com/g/open62541/c/90dpSO2Wu7E/m/mNUknnRSCAAJ . They don't work.
And in general, I tried to add any properties to my object, but it didn't work out either (UA_STATUSCODE_BADTYPEMISMATCH).
I don't understand why I can't do it?

Device Tree Bindings For mipi-dsi - Allwinner R16 to DLPC3433

I have a custom board that is supposed to use a MIPI-DSI video signal from the allwinner R16, that is supposed to be received by the TI DLPC3433.
[R16] >>>>>>> MIPI-DSI >>>>>>>> [DLPC3433]
Here are the datasheets:
https://www.ti.com/lit/ds/symlink/dlpc3433.pdf?ts=1601313127857&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FDLPC3433
https://linux-sunxi.org/images/b/b3/R16_Datasheet_V1.4_%281%29.pdf
I want to properly configure the device tree. So far, I don't have a perfect indication that any video signal is being produced. What do I need to put in my device tree configuration to make it work? I am having trouble knowing exactly with documentation and examples. Where do I need to define the properties of the DLPC3433? And how would I define the properties for the DLPC3433?
Please see parts of the device tree below:
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins_a>;
clock-frequency = <100000>; /* i2c bus frequency 100 KHz */
status = "okay";
dsi_hdmi_bridge#4d {
compatible = "ite,it6263";
reg = <0x4d>;
reset-gpios = <&pio 4 9 GPIO_ACTIVE_LOW>; /* PE9 */
port {
it6263_in_dsi: endpoint {
clock-lanes = <4>;
data-lanes = <0 1 2 3>;
remote-endpoint = <&dsi_out_it6263>;
};
};
};
};
...
&tcon0 {
// compatible = "allwinner,sun8i-a33-tcon";
status = "okay";
};
&dsi {
// compatible = "allwinner,sun6i-a31-mipi-dsi";
status = "okay";
ports {
port#1 {
reg = <1>;
dsi_out_it6263: endpoint {
remote-endpoint = <&it6263_in_dsi>;
};
};
};
};
&dphy {
// compatible = "allwinner,sun6i-a31-mipi-dphy";
status = "okay";
};
And here is what that device tree includes from the sun8i-a33.dtsi
dsi: dsi#1ca0000 {
compatible = "allwinner,sun6i-a31-mipi-dsi";
reg = <0x01ca0000 0x1000>;
interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_MIPI_DSI>,
<&ccu CLK_DSI_SCLK>;
clock-names = "bus", "mod";
resets = <&ccu RST_BUS_MIPI_DSI>;
phys = <&dphy>;
phy-names = "dphy";
status = "disabled";
ports {
#address-cells = <1>;
#size-cells = <0>;
port#0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
dsi_in_tcon0: endpoint {
remote-endpoint = <&tcon0_out_dsi>;
};
};
};
};
dphy: d-phy#1ca1000 {
compatible = "allwinner,sun6i-a31-mipi-dphy";
reg = <0x01ca1000 0x1000>;
clocks = <&ccu CLK_BUS_MIPI_DSI>,
<&ccu CLK_DSI_DPHY>;
clock-names = "bus", "mod";
resets = <&ccu RST_BUS_MIPI_DSI>;
status = "disabled";
#phy-cells = <0>;
};
fe0: display-frontend#1e00000 {
compatible = "allwinner,sun8i-a33-display-frontend";
reg = <0x01e00000 0x20000>;
interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_DE_FE>, <&ccu CLK_DE_FE>,
<&ccu CLK_DRAM_DE_FE>;
clock-names = "ahb", "mod",
"ram";
resets = <&ccu RST_BUS_DE_FE>;
ports {
#address-cells = <1>;
#size-cells = <0>;
fe0_out: port#1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
fe0_out_be0: endpoint#0 {
reg = <0>;
remote-endpoint = <&be0_in_fe0>;
};
};
};
};
be0: display-backend#1e60000 {
compatible = "allwinner,sun8i-a33-display-backend";
reg = <0x01e60000 0x10000>, <0x01e80000 0x1000>;
reg-names = "be", "sat";
interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>,
<&ccu CLK_DRAM_DE_BE>, <&ccu CLK_BUS_SAT>;
clock-names = "ahb", "mod",
"ram", "sat";
resets = <&ccu RST_BUS_DE_BE>, <&ccu RST_BUS_SAT>;
reset-names = "be", "sat";
assigned-clocks = <&ccu CLK_DE_BE>;
assigned-clock-rates = <300000000>;
ports {
#address-cells = <1>;
#size-cells = <0>;
be0_in: port#0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
be0_in_fe0: endpoint#0 {
reg = <0>;
remote-endpoint = <&fe0_out_be0>;
};
};
be0_out: port#1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
be0_out_drc0: endpoint#0 {
reg = <0>;
remote-endpoint = <&drc0_in_be0>;
};
};
};
};

STM32 cant send data with esp8266 thingspeak.what did I wrong?

I am working on a project about send PWM values and time values(with RTC) from stm32 to wifi module and bluetooth module at the same time.I wrote a code for esp8266 and esp8266 connected to my phone.But didnt send any value to bluetooth module or thingspeak.What did I wrong?(I cant use HAL Library for this project)
static void Clear_ESPBuffer(void)
{
uint16_t i;
for(i=0;i<ESP8266BUFFER_LENGHT;i++)
g_arrui8ESP8266Buf[i] = 0;
ESPWriteIndex=0;
}
//esp8266 configuration
USART_InitStruct.USART_BaudRate = 115200;
USART_InitStruct.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStruct.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
USART_InitStruct.USART_Parity = USART_Parity_No;
USART_InitStruct.USART_StopBits = USART_StopBits_1;
USART_InitStruct.USART_WordLength = USART_WordLength_8b;
USART_Init(USART1, &USART_InitStruct);
//bluetooth modulu configuration
USART_InitStruct.USART_BaudRate = 115200;
USART_InitStruct.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStruct.USART_Mode = USART_Mode_Tx;
USART_InitStruct.USART_Parity = USART_Parity_No;
USART_InitStruct.USART_StopBits = USART_StopBits_1;
USART_InitStruct.USART_WordLength = USART_WordLength_8b;
USART_Init(USART3, &USART_InitStruct);
USART_Cmd(USART3, ENABLE); // USART3 aktif edilir.
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
USART_Cmd(USART1, ENABLE);
}
static void ESP8266_Init(void)
{
static uint8_t ESPInitCase=0;
switch(ESPInitCase)
{
case 0:
// Standart AT Komutu gonderilir , Cevabi OK olmalidir.
USART_puts(USART1,"AT\r\n");
Delay(1000000L);
ESPInitCase = 1;
break;
case 1:
if (strstr(g_arrui8ESP8266Buf,"OK") != NULL)
{
Clear_ESPBuffer();
USART_puts(USART3,"Module Erisildi\n");
ESPInitCase = 2;
}
else
{
Clear_ESPBuffer();
USART_puts(USART3,"Not Founded");
ESPInitCase = 0;
}
break;
case 2:
USART_puts(USART1,"AT+CWMODE?\r\n");
Delay(1000000L);
ESPInitCase = 3;
break;
case 3:
// Gelen cevap mode 1 'mi
if (strstr(g_arrui8ESP8266Buf,"+CWMODE:1") != NULL)
{
Clear_ESPBuffer();
USART_puts(USART3,"Config okey\n");
ESPInitCase = 4;
}
else
{
.
USART_puts(USART1,"AT+CWMODE=1\r\n");
USART_puts(USART1,"AT+RST\r\n");
Delay(1000000L);
Clear_ESPBuffer();
USART_puts(USART3,"Changed Mode.\n");
ESPInitCase = 2;
}
break;
case 4:
USART_puts(USART1,"AT+CWJAP=\"Wifi\",\"Password\"\r\n");
Delay(2000000L);
ESPInitCase = 5;
break;
case 5:
if (strstr(g_arrui8ESP8266Buf,"OK") != NULL)
{
Clear_ESPBuffer();
USART_puts(USART3,"Wifi Connected\n");
ESPInitCase = 6;
}
else
{
Delay(1000000L);
USART_puts(USART3,"waiting for wifi\n");
Delay(5000000L);
say2++;
if(say2==3)
{
USART_puts(USART3,"Not Connected\n");
ESPInitCase=8;
say2=0;
}
}
break;
case 6:
// For ıp adress
USART_puts(USART1,"AT+CIFSR\r\n");
Delay(1000000L);
ESPInitCase = 7;
break;
case 7:
if (strstr(g_arrui8ESP8266Buf,"ERROR") == NULL)
{
USART_puts(USART3," IP = \n");
USART_puts(USART3,&g_arrui8ESP8266Buf[11]);
Clear_ESPBuffer();
ESPInitCase=8;
}
else
{
Delay(1000000L);
USART_puts(USART3,"Try again.\n");
Clear_ESPBuffer();
ESPInitCase=6;
}
break;
case 8:
USART_puts(USART1,"AT+CIPSTART=\"TCP\",\"IP\",80\r\n");
// 1 saniye gecikme koyuyoruz.
Delay(1000000L);
ESPInitCase = 9;
break;
case 9:
if (strstr(g_arrui8ESP8266Buf,"CONNECT") != NULL)
{
Clear_ESPBuffer();
USART_puts(USART3,"connected to website\n");
ESPInitCase = 10;
}
else
{
Delay(1000000L);
USART_puts(USART3,"waiting for Website connection\n");
Delay(50000000L);
say++;
if(say==3)
{
USART_puts(USART3," Website didnt work .\n");
ESPInitCase=8;
say=0;
}
}
break;
case 10:
Value=Read_ADC(); // adc okunuyor
sprintf(transmitdata, "GET /update?key=9KT9JQA1PJXPTFJJ&field2=%d\r\n",value);
length=strlen(transmitdata);
length=length+2;
sprintf(transmitconf,"AT+CIPSEND=%d\r\n",length);
USART_puts(USART1,transmitconf);
Delay(10000000L);
if (strstr(g_arrui8ESP8266Buf,">") != NULL)
{
Clear_ESPBuffer();
USART_puts(USART1,transmitdata);
USART_puts(USART3,"transmitted data\n");
Delay(2000000L);
ESPInitCase=10;
}
else
{
Delay(3000000L);
USART_puts(USART3,"data length not okey\n");
ESPInitCase=8;
USART_puts(USART3,"trying to connect website again\n");
say3++;
if(say3==3)
{
USART_puts(USART3,"didnt connect.\n check config\n");
ESPInitCase=0;
say3=0;
}
}
break;
}
}
void USART1_IRQHandler(void)
{
if( USART_GetITStatus(USART1, USART_IT_RXNE) )
{
uint8_t Received_Byte = USART1->DR;
USART2->DR = Received_Byte;
if(Received_Byte != 0)
{
g_arrui8ESP8266Buf[ESPWriteIndex] = Received_Byte;
ESPWriteIndex++;
}
}
}

Changing the order of multipart Geometries

I have a group of Multipart Polyline Geometries which have measures. I am trying to re-order the geometries to better follow the traffic flow.
I am using a GeometryBridge to add the re-orderd segments to an ISegmentCollection.
The problem is that my segments have their M values reset so they must be IMSegmentation4 segments. When I try to add these to an ISegmentCollection VS the program won't compile.
I am using VS2010, ArcGis 10.2 and Windows 7.
pExGeomColl = (IGeometryCollection)new Polyline();
pExGeomColl = (IGeometryCollection)pBaseFeat.ShapeCopy;
for (int i = 0; i < hGeomToFrom.Count; i++)
{
iTo = i;
iFrom = (int)hGeomToFrom[i];
pGeom = pExGeomColl.Geometry[iFrom];
pGeom.SpatialReference = pSpRef;
pMAware = (IMAware)pGeom;
pMAware.MAware = true;
pPolyline = (IPolyline6)new PolylineClass();
if (pGeom.GeometryType != esriGeometryType.esriGeometryPolyline)
{
pPolyline = geometryToPolyline(pGeom, false, true, ref sError);
if (sError.Length > 0)
{
sError = "cmdReset\r\n" + sError;
clsMain.write_log(sError, clsMain.m_eLogType.FATAL);
MessageBox.Show(sError);
return;
}
}
else
{
pPolyline = (IPolyline)pGeom;
}
dLen = pPolyline.Length;
dFrom = dMeasure;
dTo = dFrom + dLen;
pSeg = (IMSegmentation4)pPolyline;
pSeg.SetAndInterpolateMsBetween(dFrom, dTo);
dMeasure = dTo;
pSegArray[i] = pSeg;
ProgressBar1.Value = iCount;
iCount++;
}
// Add the segment array to a segment collection
pNewSegColl = (ISegmentCollection)new PolylineClass();
pMAware = (IMAware)pNewSegColl;
pMAware.MAware = true;
pGeomBridge = new GeometryEnvironmentClass();
pGeomBridge.AddSegments(pNewSegColl, pSegArray); // This doesn't work
pGeom = (IGeometry)pNewSegColl;
pGeom.SpatialReference = pSpRef;
pBaseFeat.Shape = pGeom;
pBaseFeat.Store();
Can anyone tell me how to accumulate a set of measure segments?
I found that using a Segment Collection is the wrong approach. A segment is the line segment between vertices of a polyline.
The trick is to put the polyline into a geometry collection and then add the parts of that geometry collection into the new (re-ordered) collection.
// Existing Geometry Collection
pExGeomColl = (IGeometryCollection)new PolylineClass();
pExGeomColl = (IGeometryCollection)pBaseFeat.ShapeCopy;
// New Geometry collection
pNewGeomColl = (IGeometryCollection)new PolylineClass();
pMAware = (IMAware)pNewGeomColl;
pMAware.MAware = true;
pZAware = (IZAware)pNewGeomColl;
pZAware.ZAware = bHasZ;
for (int i = 0; i < hGeomToFrom.Count; i++)
{
iTo = i;
iFrom = (int)hGeomToFrom[i];
pGeom = pExGeomColl.Geometry[iFrom];
pGeom.SpatialReference = pSpRef;
pMAware = (IMAware)pGeom;
pMAware.MAware = true;
pZAware = (IZAware)pGeom;
pZAware.ZAware = bHasZ;
// Convert the geometry to a polyline
pPolyline = (IPolyline6)new PolylineClass();
if (pGeom.GeometryType != esriGeometryType.esriGeometryPolyline)
{
pPolyline = geometryToPolyline(pGeom, bHasZ, true, ref sError);
if (sError.Length > 0)
{
sError = "cmdReset\r\n" + sError;
clsMain.write_log(sError, clsMain.m_eLogType.FATAL);
MessageBox.Show(sError);
return;
}
}
else
{
pPolyline = (IPolyline)pGeom;
}
pMAware = (IMAware)pPolyline;
pMAware.MAware = true;
pZAware = (IZAware)pPolyline;
pZAware.ZAware = bHasZ;
dLen = pPolyline.Length;
dFrom = dMeasure;
dTo = dFrom + dLen;
pSeg = (IMSegmentation4)pPolyline;
pSeg.SetAndInterpolateMsBetween(dFrom, dTo);
IGeometryCollection pXGeomColl = new PolylineClass();
pMAware = (IMAware)pXGeomColl;
pMAware.MAware = true;
pZAware = (IZAware)pXGeomColl;
pZAware.ZAware = bHasZ;
pXGeomColl = (IGeometryCollection)pPolyline;
for (int j = 0; j < pXGeomColl.GeometryCount; j++)
pNewGeomColl.AddGeometry(pXGeomColl.Geometry[j]);
dMeasure = dTo;
ProgressBar1.Value = iCount;
iCount++;
}
pGeom = (IGeometry)pNewGeomColl;
pGeom.SpatialReference = pSpRef;
pMAware = (IMAware)pGeom;
pMAware.MAware = true;
pZAware = (IZAware)pGeom;
pZAware.ZAware = bHasZ;
pBaseFeat.Shape = pGeom;
pBaseFeat.Store();